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-03-21 02:44:00 +01:00
parent bbcc203522
commit 149d033407

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;
}