Bug 991582 - Part 2: Handle the result of RIL request in a consistent way. r=aknow

This commit is contained in:
Edgar Chen 2014-05-12 18:29:53 +08:00
parent c5a00c81d0
commit 9a6aaf19c0
10 changed files with 44 additions and 90 deletions

View File

@ -156,7 +156,7 @@ CellBroadcastService.prototype = {
.getRadioInterface(clientId).sendWorkerMessage("setCellBroadcastSearchList",
{ searchList: newSearchList },
(function callback(aResponse) {
if (DEBUG && !aResponse.success) {
if (DEBUG && aResponse.errorMsg) {
debug("Failed to set new search list: " + newSearchList +
" to client id: " + clientId);
}
@ -165,7 +165,7 @@ CellBroadcastService.prototype = {
if (responses.length == numOfRilClients) {
let successCount = 0;
for (let i = 0; i < responses.length; i++) {
if (responses[i].success) {
if (!responses[i].errorMsg) {
successCount++;
}
}

View File

@ -1582,16 +1582,15 @@ RilObject.prototype = {
try {
let str = getSearchListStr(options.searchList);
this.cellBroadcastConfigs.MMI = this._convertCellBroadcastSearchList(str);
options.success = true;
} catch (e) {
if (DEBUG) {
this.context.debug("Invalid Cell Broadcast search list: " + e);
}
options.success = false;
options.errorMsg = GECKO_ERROR_UNSPECIFIED_ERROR;
}
this.sendChromeMessage(options);
if (!options.success) {
if (options.errorMsg) {
return;
}
@ -1853,7 +1852,6 @@ RilObject.prototype = {
}
let _sendMMIError = (function(errorMsg) {
options.success = false;
options.errorMsg = errorMsg;
this.sendChromeMessage(options);
}).bind(this);
@ -2028,7 +2026,6 @@ RilObject.prototype = {
return;
}
// If we already had the device's IMEI, we just send it to chrome.
options.success = true;
options.statusMessage = this.IMEI;
this.sendChromeMessage(options);
return;
@ -2163,7 +2160,6 @@ RilObject.prototype = {
*/
sendUSSD: function(options, checkSession = true) {
if (checkSession && !this._ussdSession) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
@ -2889,7 +2885,6 @@ RilObject.prototype = {
* Helper for processing responses of functions such as enterICC* and changeICC*.
*/
_processEnterAndChangeICCResponses: function(length, options) {
options.success = !options.errorMsg;
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
if (options.rilMessageType != "sendMMI") {
this.sendChromeMessage(options);
@ -2898,7 +2893,7 @@ RilObject.prototype = {
let serviceCode = options.mmi.serviceCode;
if (options.success) {
if (!options.errorMsg) {
switch (serviceCode) {
case MMI_SC_PIN:
options.statusMessage = MMI_SM_KS_PIN_CHANGED;
@ -4381,7 +4376,6 @@ RilObject.prototype = {
return;
}
options.success = !options.errorMsg;
this.sendChromeMessage(options);
},
@ -4753,7 +4747,7 @@ RilObject.prototype[REQUEST_SEND_USSD] = function REQUEST_SEND_USSD(length, opti
if (DEBUG) {
this.context.debug("REQUEST_SEND_USSD " + JSON.stringify(options));
}
options.success = (this._ussdSession = !options.errorMsg);
this._ussdSession = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, options) {
@ -4761,8 +4755,7 @@ RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length,
this.context.debug("REQUEST_CANCEL_USSD" + JSON.stringify(options));
}
options.success = !options.errorMsg;
this._ussdSession = !options.success;
this._ussdSession = !!options.errorMsg;
// The cancelUSSD is triggered by ril_worker itself.
if (this.cachedUSSDRequest) {
@ -4775,8 +4768,7 @@ RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length,
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
this.sendChromeMessage(options);
return;
}
@ -4784,7 +4776,6 @@ RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, option
let Buf = this.context.Buf;
let bufLength = Buf.readInt32();
if (!bufLength || bufLength < 2) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
@ -4806,7 +4797,6 @@ RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, option
break;
// Unknown (e.g. no network, etc.).
case 2:
options.success = false;
options.errorMsg = MMI_ERROR_KS_ERROR;
break;
// CLIR temporary mode presentation restricted.
@ -4824,7 +4814,6 @@ RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, option
options.statusMessage = MMI_SM_KS_CLIR_DEFAULT_ON_NEXT_CALL_OFF;
break;
default:
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
break;
}
@ -4844,13 +4833,11 @@ RilObject.prototype[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, option
options.statusMessage = MMI_SM_KS_CLIR_DEFAULT_OFF_NEXT_CALL_ON;
break;
default:
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
break;
}
break;
default:
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
break;
}
@ -4863,8 +4850,8 @@ RilObject.prototype[REQUEST_SET_CLIR] = function REQUEST_SET_CLIR(length, option
// The request was made by ril_worker itself automatically. Don't report.
return;
}
options.success = !options.errorMsg;
if (options.success && options.rilMessageType === "sendMMI") {
if (!options.errorMsg && options.rilMessageType === "sendMMI") {
switch (options.procedure) {
case MMI_PROCEDURE_ACTIVATION:
options.statusMessage = MMI_SM_KS_SERVICE_ENABLED;
@ -4879,8 +4866,7 @@ RilObject.prototype[REQUEST_SET_CLIR] = function REQUEST_SET_CLIR(length, option
RilObject.prototype[REQUEST_QUERY_CALL_FORWARD_STATUS] =
function REQUEST_QUERY_CALL_FORWARD_STATUS(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
this.sendChromeMessage(options);
return;
}
@ -4891,7 +4877,6 @@ RilObject.prototype[REQUEST_QUERY_CALL_FORWARD_STATUS] =
rulesLength = Buf.readInt32();
}
if (!rulesLength) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
@ -4919,8 +4904,7 @@ RilObject.prototype[REQUEST_QUERY_CALL_FORWARD_STATUS] =
};
RilObject.prototype[REQUEST_SET_CALL_FORWARD] =
function REQUEST_SET_CALL_FORWARD(length, options) {
options.success = !options.errorMsg;
if (options.success && options.rilMessageType === "sendMMI") {
if (!options.errorMsg && options.rilMessageType === "sendMMI") {
switch (options.action) {
case CALL_FORWARD_ACTION_ENABLE:
options.statusMessage = MMI_SM_KS_SERVICE_ENABLED;
@ -4940,8 +4924,7 @@ RilObject.prototype[REQUEST_SET_CALL_FORWARD] =
};
RilObject.prototype[REQUEST_QUERY_CALL_WAITING] =
function REQUEST_QUERY_CALL_WAITING(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
if (options.callback) {
// Prevent DataCloneError when sending chrome messages.
delete options.callback;
@ -4964,8 +4947,7 @@ RilObject.prototype[REQUEST_QUERY_CALL_WAITING] =
};
RilObject.prototype[REQUEST_SET_CALL_WAITING] = function REQUEST_SET_CALL_WAITING(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
if (options.callback) {
// Prevent DataCloneError when sending chrome messages.
delete options.callback;
@ -4991,8 +4973,7 @@ RilObject.prototype[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, option
return;
}
options.success = !options.errorMsg;
if (options.success && this.IMEI == null) {
if (!options.errorMsg && this.IMEI == null) {
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
}
options.statusMessage = this.IMEI;
@ -5012,14 +4993,12 @@ RilObject.prototype[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILITY_LOCK(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
this.sendChromeMessage(options);
return;
}
if (!length) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
@ -5055,10 +5034,9 @@ RilObject.prototype[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILI
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_SET_FACILITY_LOCK] = function REQUEST_SET_FACILITY_LOCK(length, options) {
options.success = !options.errorMsg;
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
if (options.success && (options.rilMessageType === "sendMMI")) {
if (!options.errorMsg && (options.rilMessageType === "sendMMI")) {
switch (options.procedure) {
case MMI_PROCEDURE_ACTIVATION:
options.statusMessage = MMI_SM_KS_SERVICE_ENABLED;
@ -5123,7 +5101,6 @@ RilObject.prototype[REQUEST_QUERY_AVAILABLE_NETWORKS] = function REQUEST_QUERY_A
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_DTMF_START] = function REQUEST_DTMF_START(length, options) {
options.success = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_DTMF_STOP] = null;
@ -5141,8 +5118,7 @@ RilObject.prototype[REQUEST_SEPARATE_CONNECTION] = function REQUEST_SEPARATE_CON
RilObject.prototype[REQUEST_SET_MUTE] = null;
RilObject.prototype[REQUEST_GET_MUTE] = null;
RilObject.prototype[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, options) {
options.success = !options.errorMsg;
if (!options.success) {
if (options.errorMsg) {
this.sendChromeMessage(options);
return;
}
@ -5150,7 +5126,6 @@ RilObject.prototype[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, op
let Buf = this.context.Buf;
let bufLength = Buf.readInt32();
if (!bufLength) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendChromeMessage(options);
return;
@ -5171,7 +5146,6 @@ RilObject.prototype[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, op
options.statusMessage = MMI_SM_KS_SERVICE_ENABLED;
break;
default:
options.success = false;
options.errorMsg = MMI_ERROR_KS_ERROR;
break;
}
@ -5520,7 +5494,6 @@ RilObject.prototype[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE] = function REQUEST_EXI
return;
}
options.success = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_GET_SMSC_ADDRESS] = function REQUEST_GET_SMSC_ADDRESS(length, options) {
@ -5639,11 +5612,9 @@ RilObject.prototype[REQUEST_SET_DATA_SUBSCRIPTION] = function REQUEST_SET_DATA_S
// The request was made by ril_worker itself. Don't report.
return;
}
options.success = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[REQUEST_GET_UNLOCK_RETRY_COUNT] = function REQUEST_GET_UNLOCK_RETRY_COUNT(length, options) {
options.success = !options.errorMsg;
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
this.sendChromeMessage(options);
};
@ -5652,11 +5623,9 @@ RilObject.prototype[RIL_REQUEST_GPRS_ATTACH] = function RIL_REQUEST_GPRS_ATTACH(
// The request was made by ril_worker itself. Don't report.
return;
}
options.success = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[RIL_REQUEST_GPRS_DETACH] = function RIL_REQUEST_GPRS_DETACH(length, options) {
options.success = !options.errorMsg;
this.sendChromeMessage(options);
};
RilObject.prototype[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED() {

View File

@ -156,7 +156,7 @@ add_test(function test_ril_worker_cellbroadcast_set_search_list() {
context.RIL.setCellBroadcastSearchList(options);
// Enforce the MMI result to string for comparison.
equal("" + context.RIL.cellBroadcastConfigs.MMI, aExpected);
equal(options.success, true);
do_check_eq(options.errorMsg, undefined);
}
let searchListStr = "1,2,3,4";

View File

@ -71,7 +71,7 @@ add_test(function test_setCallForward_unconditional() {
let postedMessage = workerHelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -115,7 +115,7 @@ add_test(function test_queryCallForwardStatus_unconditional() {
let postedMessage = workerHelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(Array.isArray(postedMessage.rules));
do_print(postedMessage.rules.length);
equal(postedMessage.rules.length, 1);

View File

@ -29,7 +29,6 @@ add_test(function test_queryCLIP_provisioned() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.provisioned, 1);
run_next_test();
});
@ -55,7 +54,6 @@ add_test(function test_getCLIP_error_generic_failure_invalid_length() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
run_next_test();
});

View File

@ -34,7 +34,6 @@ add_test(function test_setCLIR_success() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
run_next_test();
});
@ -58,7 +57,6 @@ add_test(function test_setCLIR_generic_failure() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
run_next_test();
});
@ -89,7 +87,6 @@ add_test(function test_getCLIR_n0_m1() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.n, 0);
equal(postedMessage.m, 1);
run_next_test();
@ -120,7 +117,6 @@ add_test(function test_getCLIR_error_generic_failure_invalid_length() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, "GenericFailure");
ok(!postedMessage.success);
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
run_next_test();
});

View File

@ -23,7 +23,6 @@ add_test(function test_setCallWaiting_success() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
run_next_test();
});
@ -46,7 +45,6 @@ add_test(function test_setCallWaiting_generic_failure() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
run_next_test();
});
@ -74,7 +72,6 @@ add_test(function test_queryCallWaiting_success_enabled_true() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.length, 1);
ok(postedMessage.enabled);
run_next_test();
@ -103,7 +100,6 @@ add_test(function test_queryCallWaiting_success_enabled_false() {
let postedMessage = workerHelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
equal(postedMessage.length, 1);
ok(!postedMessage.enabled);
run_next_test();

View File

@ -63,7 +63,7 @@ add_test(function test_sendMMI_short_code() {
let postedMessage = workerhelper.postedMessage;
equal(ussdOptions.ussd, "**");
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(context.RIL._ussdSession);
run_next_test();
@ -84,7 +84,7 @@ add_test(function test_sendMMI_change_PIN() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -132,7 +132,7 @@ add_test(function test_sendMMI_change_PIN2() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -180,7 +180,7 @@ add_test(function test_sendMMI_unblock_PIN() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -228,7 +228,7 @@ add_test(function test_sendMMI_unblock_PIN2() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -277,7 +277,7 @@ add_test(function test_sendMMI_get_IMEI() {
let postedMessage = workerhelper.postedMessage;
notEqual(mmiOptions.mmi, null);
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
run_next_test();
});
@ -301,7 +301,6 @@ add_test(function test_sendMMI_get_IMEI_error() {
notEqual(mmiOptions.mmi, null);
equal (postedMessage.errorMsg, GECKO_ERROR_RADIO_NOT_AVAILABLE);
ok(!postedMessage.success);
run_next_test();
});
@ -327,7 +326,7 @@ add_test(function test_sendMMI_call_barring_BAIC_interrogation_voice() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.enabled);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED_FOR);
ok(Array.isArray(postedMessage.additionalInformation));
@ -357,7 +356,7 @@ add_test(function test_sendMMI_call_barring_BAIC_activation() {
let postedMessage = workerhelper.postedMessage;
equal(mmiOptions.procedure, MMI_PROCEDURE_ACTIVATION);
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_ENABLED);
run_next_test();
@ -384,7 +383,7 @@ add_test(function test_sendMMI_call_barring_BAIC_deactivation() {
let postedMessage = workerhelper.postedMessage;
equal(mmiOptions.procedure, MMI_PROCEDURE_DEACTIVATION);
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
equal(postedMessage.statusMessage, MMI_SM_KS_SERVICE_DISABLED);
run_next_test();
@ -413,7 +412,7 @@ add_test(function test_sendMMI_USSD() {
let postedMessage = workerhelper.postedMessage;
equal(ussdOptions.ussd, "**123#");
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
ok(context.RIL._ussdSession);
run_next_test();
@ -439,7 +438,6 @@ add_test(function test_sendMMI_USSD_error() {
equal(ussdOptions.ussd, "**123#");
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
ok(!context.RIL._ussdSession);
run_next_test();
@ -459,7 +457,7 @@ function setCallWaitingSuccess(mmi) {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
}
add_test(function test_sendMMI_call_waiting_activation() {
@ -509,7 +507,7 @@ add_test(function test_sendMMI_call_waiting_interrogation() {
let postedMessage = workerhelper.postedMessage;
ok(postedMessage.success);
equal(postedMessage.errorMsg, undefined);
equal(postedMessage.length, 2);
ok(postedMessage.enabled);
run_next_test();

View File

@ -36,7 +36,6 @@ function setCallForwardSuccess(procedure, serviceCode, sia, sib, sic) {
let postedMessage = workerhelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
}
add_test(function test_sendMMI_call_forwarding_activation() {
@ -82,7 +81,6 @@ add_test(function test_sendMMI_call_forwarding_interrogation() {
let postedMessage = workerhelper.postedMessage;
equal(postedMessage.errorMsg, undefined);
ok(postedMessage.success);
ok(Array.isArray(postedMessage.rules));
equal(postedMessage.rules.length, 1);
ok(postedMessage.rules[0].active);
@ -110,7 +108,6 @@ add_test(function test_sendMMI_call_forwarding_interrogation_no_rules() {
let postedMessage = workerhelper.postedMessage;
equal(postedMessage.errorMsg, GECKO_ERROR_GENERIC_FAILURE);
ok(!postedMessage.success);
run_next_test();
});

View File

@ -783,7 +783,7 @@ TelephonyService.prototype = {
_dialCdmaThreeWayCall: function(aClientId, aNumber, aCallback) {
this._sendToRilWorker(aClientId, "cdmaFlash", { featureStr: aNumber },
response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(response.errorMsg);
return;
}
@ -824,7 +824,7 @@ TelephonyService.prototype = {
this._sendToRilWorker(aClientId, "dial", aOptions, response => {
this._isDialing = false;
if (!response.success) {
if (response.errorMsg) {
this._sendToRilWorker(aClientId, "getFailCause", null, response => {
aCallback.notifyError(response.failCause);
});
@ -857,7 +857,7 @@ TelephonyService.prototype = {
{ mmi: aMmi }, response => {
if (DEBUG) debug("MMI response: " + JSON.stringify(response));
if (!response.success) {
if (response.errorMsg) {
if (response.additionalInformation != null) {
aCallback.notifyDialMMIErrorWithInfo(response.errorMsg,
response.additionalInformation);
@ -973,7 +973,7 @@ TelephonyService.prototype = {
* The response from ril_worker.
*/
_defaultCallbackHandler: function(aCallback, aResponse) {
if (!aResponse.success) {
if (aResponse.errorMsg) {
aCallback.notifyError(aResponse.errorMsg);
} else {
aCallback.notifySuccess();
@ -1080,7 +1080,7 @@ TelephonyService.prototype = {
let tones = aDtmfChars;
let playTone = (tone) => {
this._sendToRilWorker(aClientId, "startTone", { dtmfChar: tone }, response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(response.errorMsg);
return;
}
@ -1242,7 +1242,7 @@ TelephonyService.prototype = {
_conferenceCallGsm: function(aClientId, aCallback) {
this._sendToRilWorker(aClientId, "conferenceCall", null, response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
// TODO: Bug 1124993. Deprecate it. Use callback response is enough.
this._notifyAllListeners("notifyConferenceError",
@ -1264,7 +1264,7 @@ TelephonyService.prototype = {
}
this._sendToRilWorker(aClientId, "cdmaFlash", null, response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
// TODO: Bug 1124993. Deprecate it. Use callback response is enough.
this._notifyAllListeners("notifyConferenceError",
@ -1302,7 +1302,7 @@ TelephonyService.prototype = {
_separateCallGsm: function(aClientId, aCallIndex, aCallback) {
this._sendToRilWorker(aClientId, "separateCall", { callIndex: aCallIndex },
response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
// TODO: Bug 1124993. Deprecate it. Use callback response is enough.
this._notifyAllListeners("notifyConferenceError",
@ -1332,7 +1332,7 @@ TelephonyService.prototype = {
// controlling subscriber and the second party. Go to the 2-way state.
_separateCallCdma: function(aClientId, aCallIndex, aCallback) {
this._sendToRilWorker(aClientId, "cdmaFlash", null, response => {
if (!response.success) {
if (response.errorMsg) {
aCallback.notifyError(RIL.GECKO_ERROR_GENERIC_FAILURE);
// TODO: Bug 1124993. Deprecate it. Use callback response is enough.
this._notifyAllListeners("notifyConferenceError",