Bug 984919 - Part 1: Cannot place a new call if other sim is in use. r=hsinyi

This commit is contained in:
Szu-Yu Chen (Aknow) 2014-04-01 08:58:55 -04:00
parent 3729e45eb8
commit b18813e421

View File

@ -35,6 +35,9 @@ const CALL_WAKELOCK_TIMEOUT = 5000;
// Index of the CDMA second call which isn't held in RIL but only in TelephoyProvider.
const CDMA_SECOND_CALL_INDEX = 2;
const DIAL_ERROR_INVALID_STATE_ERROR = "InvalidStateError";
const DIAL_ERROR_OTHER_CONNECTION_IN_USE = "OtherConnectionInUse";
let DEBUG;
function debug(s) {
dump("TelephonyProvider: " + s + "\n");
@ -420,7 +423,25 @@ TelephonyProvider.prototype = {
if (this.isDialing) {
if (DEBUG) debug("Already has a dialing call. Drop.");
aTelephonyCallback.notifyDialError("InvalidStateError");
aTelephonyCallback.notifyDialError(DIAL_ERROR_INVALID_STATE_ERROR);
return;
}
// For DSDS, if there is aleady a call on SIM X, we cannot place any new
// call on other SIM.
let callOnOtherSim = false;
for (let cid = 0; cid < this._numClients; ++cid) {
if (cid === aClientId) {
continue;
}
if (Object.keys(this._currentCalls[cid]).length !== 0) {
callOnOtherSim = true;
break;
}
}
if (callOnOtherSim) {
if (DEBUG) debug("Already has a call on other sim. Drop.");
aTelephonyCallback.notifyDialError(DIAL_ERROR_OTHER_CONNECTION_IN_USE);
return;
}