Bug 990472 - Part 1: Refactor: check of call on other client. r=hsinyi

This commit is contained in:
Szu-Yu Chen [:aknow] 2014-04-16 10:26:50 -04:00
parent d9761e4a35
commit c31a9c5dc3

View File

@ -430,19 +430,21 @@ TelephonyProvider.prototype = {
return; return;
} }
// For DSDS, if there is aleady a call on SIM X, we cannot place any new function hasCallsOnOtherClient(aClientId) {
// call on other SIM. for (let cid = 0; cid < this._numClients; ++cid) {
let callOnOtherSim = false; if (cid === aClientId) {
for (let cid = 0; cid < this._numClients; ++cid) { continue;
if (cid === aClientId) { }
continue; if (Object.keys(this._currentCalls[cid]).length !== 0) {
} return true;
if (Object.keys(this._currentCalls[cid]).length !== 0) { }
callOnOtherSim = true;
break;
} }
return false;
} }
if (callOnOtherSim) {
// For DSDS, if there is aleady a call on SIM 'aClientId', we cannot place
// any new call on other SIM.
if (hasCallsOnOtherClient.call(this, aClientId)) {
if (DEBUG) debug("Already has a call on other sim. Drop."); if (DEBUG) debug("Already has a call on other sim. Drop.");
aTelephonyCallback.notifyDialError(DIAL_ERROR_OTHER_CONNECTION_IN_USE); aTelephonyCallback.notifyDialError(DIAL_ERROR_OTHER_CONNECTION_IN_USE);
return; return;