зеркало из https://github.com/mozilla/gecko-dev.git
Bug 991582 - Part 1: Deprecate rilRequestError. r=aknow
This commit is contained in:
Родитель
081c797f3f
Коммит
11bbeeac1b
|
@ -270,13 +270,10 @@ SmsService.prototype = {
|
|||
// Failed to send SMS out.
|
||||
if (aResponse.errorMsg) {
|
||||
let error = Ci.nsIMobileMessageCallback.UNKNOWN_ERROR;
|
||||
switch (aResponse.errorMsg) {
|
||||
case RIL.ERROR_RADIO_NOT_AVAILABLE:
|
||||
error = Ci.nsIMobileMessageCallback.NO_SIGNAL_ERROR;
|
||||
break;
|
||||
case RIL.ERROR_FDN_CHECK_FAILURE:
|
||||
error = Ci.nsIMobileMessageCallback.FDN_CHECK_ERROR;
|
||||
break;
|
||||
if (aResponse.errorMsg === RIL.GECKO_ERROR_RADIO_NOT_AVAILABLE) {
|
||||
error = Ci.nsIMobileMessageCallback.NO_SIGNAL_ERROR;
|
||||
} else if (aResponse.errorMsg === RIL.GECKO_ERROR_FDN_CHECK_FAILURE) {
|
||||
error = Ci.nsIMobileMessageCallback.FDN_CHECK_ERROR;
|
||||
}
|
||||
|
||||
if (aSilent) {
|
||||
|
|
|
@ -2889,7 +2889,7 @@ RilObject.prototype = {
|
|||
* Helper for processing responses of functions such as enterICC* and changeICC*.
|
||||
*/
|
||||
_processEnterAndChangeICCResponses: function(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
|
||||
if (options.rilMessageType != "sendMMI") {
|
||||
this.sendChromeMessage(options);
|
||||
|
@ -3951,29 +3951,26 @@ RilObject.prototype = {
|
|||
* Sms information.
|
||||
*/
|
||||
_processSmsSendResult: function(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
if (DEBUG) {
|
||||
this.context.debug("_processSmsSendResult: rilRequestError = " +
|
||||
options.rilRequestError);
|
||||
this.context.debug("_processSmsSendResult: errorMsg = " +
|
||||
options.errorMsg);
|
||||
}
|
||||
switch (options.rilRequestError) {
|
||||
case ERROR_SMS_SEND_FAIL_RETRY:
|
||||
if (options.retryCount < SMS_RETRY_MAX) {
|
||||
options.retryCount++;
|
||||
// TODO: bug 736702 TP-MR, retry interval, retry timeout
|
||||
this.sendSMS(options);
|
||||
break;
|
||||
}
|
||||
// Fallback to default error handling if it meets max retry count.
|
||||
// Fall through.
|
||||
default:
|
||||
this.sendChromeMessage({
|
||||
rilMessageType: options.rilMessageType,
|
||||
rilMessageToken: options.rilMessageToken,
|
||||
errorMsg: options.rilRequestError,
|
||||
});
|
||||
break;
|
||||
|
||||
if (options.errorMsg === GECKO_ERROR_SMS_SEND_FAIL_RETRY &&
|
||||
options.retryCount < SMS_RETRY_MAX) {
|
||||
options.retryCount++;
|
||||
// TODO: bug 736702 TP-MR, retry interval, retry timeout
|
||||
this.sendSMS(options);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback to default error handling if it meets max retry count.
|
||||
this.sendChromeMessage({
|
||||
rilMessageType: options.rilMessageType,
|
||||
rilMessageToken: options.rilMessageToken,
|
||||
errorMsg: options.errorMsg,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4384,7 +4381,7 @@ RilObject.prototype = {
|
|||
return;
|
||||
}
|
||||
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
},
|
||||
|
||||
|
@ -4416,7 +4413,7 @@ RilObject.prototype = {
|
|||
};
|
||||
|
||||
RilObject.prototype[REQUEST_GET_SIM_STATUS] = function REQUEST_GET_SIM_STATUS(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4482,7 +4479,7 @@ RilObject.prototype[REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE] =
|
|||
};
|
||||
RilObject.prototype[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CALLS(length, options) {
|
||||
// Retry getCurrentCalls several times when error occurs.
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
if (this._getCurrentCallsRetryCount < GET_CURRENT_CALLS_RETRY_MAX) {
|
||||
this._getCurrentCallsRetryCount++;
|
||||
this.getCurrentCalls(options);
|
||||
|
@ -4554,7 +4551,7 @@ RilObject.prototype[REQUEST_DIAL_EMERGENCY_CALL] = function REQUEST_DIAL_EMERGEN
|
|||
RilObject.prototype[REQUEST_DIAL].call(this, length, options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4589,7 +4586,7 @@ RilObject.prototype[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_F
|
|||
// Treat it as CALL_FAIL_ERROR_UNSPECIFIED if the request failed.
|
||||
let failCause = CALL_FAIL_ERROR_UNSPECIFIED;
|
||||
|
||||
if (options.rilRequestError === 0) {
|
||||
if (!options.errorMsg) {
|
||||
let Buf = this.context.Buf;
|
||||
let num = length ? Buf.readInt32() : 0;
|
||||
|
||||
|
@ -4606,7 +4603,7 @@ RilObject.prototype[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_F
|
|||
RilObject.prototype[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(length, options) {
|
||||
this._receivedNetworkInfo(NETWORK_INFO_SIGNAL);
|
||||
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4639,7 +4636,7 @@ RilObject.prototype[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(
|
|||
RilObject.prototype[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_REGISTRATION_STATE(length, options) {
|
||||
this._receivedNetworkInfo(NETWORK_INFO_VOICE_REGISTRATION_STATE);
|
||||
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4651,7 +4648,7 @@ RilObject.prototype[REQUEST_VOICE_REGISTRATION_STATE] = function REQUEST_VOICE_R
|
|||
RilObject.prototype[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REGISTRATION_STATE(length, options) {
|
||||
this._receivedNetworkInfo(NETWORK_INFO_DATA_REGISTRATION_STATE);
|
||||
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4661,7 +4658,7 @@ RilObject.prototype[REQUEST_DATA_REGISTRATION_STATE] = function REQUEST_DATA_REG
|
|||
RilObject.prototype[REQUEST_OPERATOR] = function REQUEST_OPERATOR(length, options) {
|
||||
this._receivedNetworkInfo(NETWORK_INFO_OPERATOR);
|
||||
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4694,8 +4691,7 @@ RilObject.prototype.readSetupDataCall_v5 = function readSetupDataCall_v5(options
|
|||
};
|
||||
|
||||
RilObject.prototype[REQUEST_SETUP_DATA_CALL] = function REQUEST_SETUP_DATA_CALL(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -4721,7 +4717,7 @@ RilObject.prototype[REQUEST_SETUP_DATA_CALL] = function REQUEST_SETUP_DATA_CALL(
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SIM_IO] = function REQUEST_SIM_IO(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
if (options.onerror) {
|
||||
options.onerror(options.errorMsg);
|
||||
}
|
||||
|
@ -4757,7 +4753,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.rilRequestError === 0);
|
||||
options.success = (this._ussdSession = !options.errorMsg);
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, options) {
|
||||
|
@ -4765,7 +4761,7 @@ RilObject.prototype[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length,
|
|||
this.context.debug("REQUEST_CANCEL_USSD" + JSON.stringify(options));
|
||||
}
|
||||
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this._ussdSession = !options.success;
|
||||
|
||||
// The cancelUSSD is triggered by ril_worker itself.
|
||||
|
@ -4779,7 +4775,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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
|
@ -4867,7 +4863,7 @@ 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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (options.success && options.rilMessageType === "sendMMI") {
|
||||
switch (options.procedure) {
|
||||
case MMI_PROCEDURE_ACTIVATION:
|
||||
|
@ -4883,7 +4879,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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
|
@ -4923,7 +4919,7 @@ RilObject.prototype[REQUEST_QUERY_CALL_FORWARD_STATUS] =
|
|||
};
|
||||
RilObject.prototype[REQUEST_SET_CALL_FORWARD] =
|
||||
function REQUEST_SET_CALL_FORWARD(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (options.success && options.rilMessageType === "sendMMI") {
|
||||
switch (options.action) {
|
||||
case CALL_FORWARD_ACTION_ENABLE:
|
||||
|
@ -4944,7 +4940,7 @@ RilObject.prototype[REQUEST_SET_CALL_FORWARD] =
|
|||
};
|
||||
RilObject.prototype[REQUEST_QUERY_CALL_WAITING] =
|
||||
function REQUEST_QUERY_CALL_WAITING(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
if (options.callback) {
|
||||
// Prevent DataCloneError when sending chrome messages.
|
||||
|
@ -4968,7 +4964,7 @@ RilObject.prototype[REQUEST_QUERY_CALL_WAITING] =
|
|||
};
|
||||
|
||||
RilObject.prototype[REQUEST_SET_CALL_WAITING] = function REQUEST_SET_CALL_WAITING(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
if (options.callback) {
|
||||
// Prevent DataCloneError when sending chrome messages.
|
||||
|
@ -4995,7 +4991,7 @@ RilObject.prototype[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, option
|
|||
return;
|
||||
}
|
||||
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (options.success && this.IMEI == null) {
|
||||
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
|
||||
}
|
||||
|
@ -5003,7 +4999,7 @@ RilObject.prototype[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, option
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_IMEISV] = function REQUEST_GET_IMEISV(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5013,14 +5009,10 @@ RilObject.prototype[REQUEST_ANSWER] = function REQUEST_ANSWER(length, options) {
|
|||
this.sendDefaultResponse(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_DATA_CALL(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
}
|
||||
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILITY_LOCK(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
|
@ -5063,7 +5055,7 @@ 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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
|
||||
|
||||
if (options.success && (options.rilMessageType === "sendMMI")) {
|
||||
|
@ -5091,7 +5083,7 @@ RilObject.prototype[REQUEST_CHANGE_BARRING_PASSWORD] =
|
|||
RilObject.prototype[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUERY_NETWORK_SELECTION_MODE(length, options) {
|
||||
this._receivedNetworkInfo(NETWORK_INFO_NETWORK_SELECTION_MODE);
|
||||
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5113,30 +5105,30 @@ RilObject.prototype[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUE
|
|||
this._updateNetworkSelectionMode(selectionMode);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function REQUEST_SET_NETWORK_SELECTION_AUTOMATIC(length, options) {
|
||||
if (!options.rilRequestError) {
|
||||
if (!options.errorMsg) {
|
||||
this._updateNetworkSelectionMode(GECKO_NETWORK_SELECTION_AUTOMATIC);
|
||||
}
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function REQUEST_SET_NETWORK_SELECTION_MANUAL(length, options) {
|
||||
if (!options.rilRequestError) {
|
||||
if (!options.errorMsg) {
|
||||
this._updateNetworkSelectionMode(GECKO_NETWORK_SELECTION_MANUAL);
|
||||
}
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_QUERY_AVAILABLE_NETWORKS] = function REQUEST_QUERY_AVAILABLE_NETWORKS(length, options) {
|
||||
if (!options.rilRequestError) {
|
||||
if (!options.errorMsg) {
|
||||
options.networks = this._processNetworks();
|
||||
}
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_DTMF_START] = function REQUEST_DTMF_START(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_DTMF_STOP] = null;
|
||||
RilObject.prototype[REQUEST_BASEBAND_VERSION] = function REQUEST_BASEBAND_VERSION(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5149,7 +5141,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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
if (!options.success) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
|
@ -5245,9 +5237,8 @@ RilObject.prototype.readDataCall_v6 = function(options) {
|
|||
};
|
||||
|
||||
RilObject.prototype[REQUEST_DATA_CALL_LIST] = function REQUEST_DATA_CALL_LIST(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
if (options.rilMessageType) {
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
this.sendChromeMessage(options);
|
||||
}
|
||||
return;
|
||||
|
@ -5290,7 +5281,7 @@ RilObject.prototype[REQUEST_OEM_HOOK_STRINGS] = null;
|
|||
RilObject.prototype[REQUEST_SCREEN_STATE] = null;
|
||||
RilObject.prototype[REQUEST_SET_SUPP_SVC_NOTIFICATION] = null;
|
||||
RilObject.prototype[REQUEST_WRITE_SMS_TO_SIM] = function REQUEST_WRITE_SMS_TO_SIM(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
// `The MS shall return a "protocol error, unspecified" error message if
|
||||
// the short message cannot be stored in the (U)SIM, and there is other
|
||||
// message storage available at the MS` ~ 3GPP TS 23.038 section 4. Here
|
||||
|
@ -5313,7 +5304,7 @@ RilObject.prototype[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function REQUEST_SET_P
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_PREFERRED_NETWORK_TYPE(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5322,7 +5313,7 @@ RilObject.prototype[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_P
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_NEIGHBORING_CELL_IDS] = function REQUEST_GET_NEIGHBORING_CELL_IDS(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5385,7 +5376,7 @@ RilObject.prototype[REQUEST_GET_NEIGHBORING_CELL_IDS] = function REQUEST_GET_NEI
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_CELL_INFO_LIST] = function REQUEST_GET_CELL_INFO_LIST(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5449,7 +5440,7 @@ RilObject.prototype[REQUEST_CDMA_SET_ROAMING_PREFERENCE] = function REQUEST_CDMA
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_CDMA_QUERY_ROAMING_PREFERENCE] = function REQUEST_CDMA_QUERY_ROAMING_PREFERENCE(length, options) {
|
||||
if (!options.rilRequestError) {
|
||||
if (!options.errorMsg) {
|
||||
options.mode = this.context.Buf.readInt32List()[0];
|
||||
}
|
||||
this.sendChromeMessage(options);
|
||||
|
@ -5460,7 +5451,7 @@ RilObject.prototype[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE] = function RE
|
|||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE] = function REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5480,20 +5471,22 @@ RilObject.prototype[REQUEST_CDMA_SEND_SMS] = function REQUEST_CDMA_SEND_SMS(leng
|
|||
RilObject.prototype[REQUEST_CDMA_SMS_ACKNOWLEDGE] = null;
|
||||
RilObject.prototype[REQUEST_GSM_GET_BROADCAST_SMS_CONFIG] = null;
|
||||
RilObject.prototype[REQUEST_GSM_SET_BROADCAST_SMS_CONFIG] = function REQUEST_GSM_SET_BROADCAST_SMS_CONFIG(length, options) {
|
||||
if (options.rilRequestError == ERROR_SUCCESS) {
|
||||
this.setSmsBroadcastActivation(true);
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
this.setSmsBroadcastActivation(true);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GSM_SMS_BROADCAST_ACTIVATION] = null;
|
||||
RilObject.prototype[REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG] = null;
|
||||
RilObject.prototype[REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG] = function REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG(length, options) {
|
||||
if (options.rilRequestError == ERROR_SUCCESS) {
|
||||
this.setSmsBroadcastActivation(true);
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
this.setSmsBroadcastActivation(true);
|
||||
};
|
||||
RilObject.prototype[REQUEST_CDMA_SMS_BROADCAST_ACTIVATION] = null;
|
||||
RilObject.prototype[REQUEST_CDMA_SUBSCRIPTION] = function REQUEST_CDMA_SUBSCRIPTION(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5510,7 +5503,7 @@ RilObject.prototype[REQUEST_CDMA_SUBSCRIPTION] = function REQUEST_CDMA_SUBSCRIPT
|
|||
RilObject.prototype[REQUEST_CDMA_WRITE_SMS_TO_RUIM] = null;
|
||||
RilObject.prototype[REQUEST_CDMA_DELETE_SMS_ON_RUIM] = null;
|
||||
RilObject.prototype[REQUEST_DEVICE_IDENTITY] = function REQUEST_DEVICE_IDENTITY(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5527,11 +5520,11 @@ RilObject.prototype[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE] = function REQUEST_EXI
|
|||
return;
|
||||
}
|
||||
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_GET_SMSC_ADDRESS] = function REQUEST_GET_SMSC_ADDRESS(length, options) {
|
||||
this.SMSC = options.rilRequestError ? null : this.context.Buf.readString();
|
||||
this.SMSC = options.errorMsg ? null : this.context.Buf.readString();
|
||||
|
||||
if (!options.rilMessageType || options.rilMessageType !== "getSmscAddress") {
|
||||
return;
|
||||
|
@ -5542,14 +5535,14 @@ RilObject.prototype[REQUEST_GET_SMSC_ADDRESS] = function REQUEST_GET_SMSC_ADDRES
|
|||
};
|
||||
RilObject.prototype[REQUEST_SET_SMSC_ADDRESS] = null;
|
||||
RilObject.prototype[REQUEST_REPORT_SMS_MEMORY_STATUS] = function REQUEST_REPORT_SMS_MEMORY_STATUS(length, options) {
|
||||
this.pendingToReportSmsMemoryStatus = options.rilRequestError != ERROR_SUCCESS;
|
||||
this.pendingToReportSmsMemoryStatus = !!options.errorMsg;
|
||||
};
|
||||
RilObject.prototype[REQUEST_REPORT_STK_SERVICE_IS_RUNNING] = null;
|
||||
RilObject.prototype[REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE] = null;
|
||||
RilObject.prototype[REQUEST_ISIM_AUTHENTICATION] = null;
|
||||
RilObject.prototype[REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU] = null;
|
||||
RilObject.prototype[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = function REQUEST_STK_SEND_ENVELOPE_WITH_STATUS(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.acknowledgeGsmSms(false, PDU_FCS_UNSPECIFIED);
|
||||
return;
|
||||
}
|
||||
|
@ -5576,10 +5569,10 @@ RilObject.prototype[REQUEST_STK_SEND_ENVELOPE_WITH_STATUS] = function REQUEST_ST
|
|||
this.acknowledgeIncomingGsmSmsWithPDU(success, responsePduLen, options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_VOICE_RADIO_TECH] = function REQUEST_VOICE_RADIO_TECH(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
if (DEBUG) {
|
||||
this.context.debug("Error when getting voice radio tech: " +
|
||||
options.rilRequestError);
|
||||
options.errorMsg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -5593,7 +5586,7 @@ RilObject.prototype[REQUEST_IMS_REGISTRATION_STATE] = null;
|
|||
RilObject.prototype[REQUEST_IMS_SEND_SMS] = null;
|
||||
RilObject.prototype[REQUEST_SIM_TRANSMIT_APDU_BASIC] = null;
|
||||
RilObject.prototype[REQUEST_SIM_OPEN_CHANNEL] = function REQUEST_SIM_OPEN_CHANNEL(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5607,7 +5600,7 @@ RilObject.prototype[REQUEST_SIM_CLOSE_CHANNEL] = function REQUEST_SIM_CLOSE_CHAN
|
|||
this.sendDefaultResponse(options);
|
||||
};
|
||||
RilObject.prototype[REQUEST_SIM_TRANSMIT_APDU_CHANNEL] = function REQUEST_SIM_TRANSMIT_APDU_CHANNEL(length, options) {
|
||||
if (options.rilRequestError) {
|
||||
if (options.errorMsg) {
|
||||
this.sendChromeMessage(options);
|
||||
return;
|
||||
}
|
||||
|
@ -5646,11 +5639,11 @@ 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.rilRequestError === 0);
|
||||
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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
options.retryCount = length ? this.context.Buf.readInt32List()[0] : -1;
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
|
@ -5659,11 +5652,11 @@ 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.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[RIL_REQUEST_GPRS_DETACH] = function RIL_REQUEST_GPRS_DETACH(length, options) {
|
||||
options.success = (options.rilRequestError === 0);
|
||||
options.success = !options.errorMsg;
|
||||
this.sendChromeMessage(options);
|
||||
};
|
||||
RilObject.prototype[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED() {
|
||||
|
@ -5858,14 +5851,14 @@ RilObject.prototype[UNSOLICITED_NITZ_TIME_RECEIVED] = function UNSOLICITED_NITZ_
|
|||
};
|
||||
|
||||
RilObject.prototype[UNSOLICITED_SIGNAL_STRENGTH] = function UNSOLICITED_SIGNAL_STRENGTH(length) {
|
||||
this[REQUEST_SIGNAL_STRENGTH](length, {rilRequestError: ERROR_SUCCESS});
|
||||
this[REQUEST_SIGNAL_STRENGTH](length, {});
|
||||
};
|
||||
RilObject.prototype[UNSOLICITED_DATA_CALL_LIST_CHANGED] = function UNSOLICITED_DATA_CALL_LIST_CHANGED(length) {
|
||||
if (this.v5Legacy) {
|
||||
this.getDataCallList();
|
||||
return;
|
||||
}
|
||||
this[REQUEST_DATA_CALL_LIST](length, {rilRequestError: ERROR_SUCCESS});
|
||||
this[REQUEST_DATA_CALL_LIST](length, {});
|
||||
};
|
||||
RilObject.prototype[UNSOLICITED_SUPP_SVC_NOTIFICATION] = function UNSOLICITED_SUPP_SVC_NOTIFICATION(length) {
|
||||
let Buf = this.context.Buf;
|
||||
|
|
|
@ -79,7 +79,6 @@
|
|||
this.mTokenRequestMap.delete(token);
|
||||
requestType = options.rilRequestType;
|
||||
|
||||
options.rilRequestError = error;
|
||||
if (error !== ERROR_SUCCESS) {
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[error] ||
|
||||
GECKO_ERROR_UNSPECIFIED_ERROR;
|
||||
|
@ -126,7 +125,6 @@
|
|||
options = {};
|
||||
}
|
||||
options.rilRequestType = type;
|
||||
options.rilRequestError = null;
|
||||
this.mTokenRequestMap.set(this.mToken, options);
|
||||
this.mToken++;
|
||||
return this.mToken;
|
||||
|
|
|
@ -48,9 +48,7 @@ add_test(function test_check_change_call_barring_password_result() {
|
|||
context.RIL.changeCallBarringPassword =
|
||||
function fakeChangeCallBarringPassword(options) {
|
||||
barringPasswordOptions = options;
|
||||
context.RIL[REQUEST_CHANGE_BARRING_PASSWORD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_CHANGE_BARRING_PASSWORD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.changeCallBarringPassword({pin: PIN, newPin: NEW_PIN});
|
||||
|
|
|
@ -58,9 +58,7 @@ add_test(function test_setCallForward_unconditional() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setCallForward = function fakeSetCallForward(options) {
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.setCallForward({
|
||||
|
@ -84,9 +82,7 @@ add_test(function test_queryCallForwardStatus_unconditional() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setCallForward = function fakeSetCallForward(options) {
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {});
|
||||
};
|
||||
|
||||
context.Buf.readInt32 = function fakeReadUint32() {
|
||||
|
@ -106,9 +102,7 @@ add_test(function test_queryCallForwardStatus_unconditional() {
|
|||
1, // rules.active
|
||||
1 // rulesLength
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryCallForwardStatus({
|
||||
|
|
|
@ -21,9 +21,7 @@ add_test(function test_queryCLIP_provisioned() {
|
|||
1, // CLIP provisioned.
|
||||
1 // Length.
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CLIP](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CLIP](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryCLIP({});
|
||||
|
@ -50,9 +48,7 @@ add_test(function test_getCLIP_error_generic_failure_invalid_length() {
|
|||
1, // CLIP provisioned.
|
||||
0 // Length.
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CLIP](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CLIP](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryCLIP({});
|
||||
|
|
|
@ -23,8 +23,7 @@ add_test(function test_setCLIR_success() {
|
|||
|
||||
context.RIL.setCLIR = function fakeSetCLIR(options) {
|
||||
context.RIL[REQUEST_SET_CLIR](0, {
|
||||
rilMessageType: "setCLIR",
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
rilMessageType: "setCLIR"
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -48,7 +47,6 @@ add_test(function test_setCLIR_generic_failure() {
|
|||
context.RIL.setCLIR = function fakeSetCLIR(options) {
|
||||
context.RIL[REQUEST_SET_CLIR](0, {
|
||||
rilMessageType: "setCLIR",
|
||||
rilRequestError: ERROR_GENERIC_FAILURE,
|
||||
errorMsg: GECKO_ERROR_GENERIC_FAILURE
|
||||
});
|
||||
};
|
||||
|
@ -82,8 +80,7 @@ add_test(function test_getCLIR_n0_m1() {
|
|||
2 // Length.
|
||||
];
|
||||
context.RIL[REQUEST_GET_CLIR](1, {
|
||||
rilMessageType: "setCLIR",
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
rilMessageType: "setCLIR"
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -115,8 +112,7 @@ add_test(function test_getCLIR_error_generic_failure_invalid_length() {
|
|||
0 // Length (invalid one).
|
||||
];
|
||||
context.RIL[REQUEST_GET_CLIR](1, {
|
||||
rilMessageType: "setCLIR",
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
rilMessageType: "setCLIR"
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -13,9 +13,7 @@ add_test(function test_setCallWaiting_success() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setCallWaiting = function fakeSetCallWaiting(options) {
|
||||
context.RIL[REQUEST_SET_CALL_WAITING](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SET_CALL_WAITING](0, {});
|
||||
};
|
||||
|
||||
context.RIL.setCallWaiting({
|
||||
|
@ -37,7 +35,6 @@ add_test(function test_setCallWaiting_generic_failure() {
|
|||
|
||||
context.RIL.setCallWaiting = function fakeSetCallWaiting(options) {
|
||||
context.RIL[REQUEST_SET_CALL_WAITING](0, {
|
||||
rilRequestError: ERROR_GENERIC_FAILURE,
|
||||
errorMsg: GECKO_ERROR_GENERIC_FAILURE
|
||||
});
|
||||
};
|
||||
|
@ -69,9 +66,7 @@ add_test(function test_queryCallWaiting_success_enabled_true() {
|
|||
1, // enabled
|
||||
1 // length
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryCallWaiting({});
|
||||
|
@ -100,9 +95,7 @@ add_test(function test_queryCallWaiting_success_enabled_false() {
|
|||
0, // enabled
|
||||
1 // length
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryCallWaiting({});
|
||||
|
|
|
@ -151,8 +151,7 @@ add_test(function test_request_exit_emergencyCbMode_explicitly() {
|
|||
|
||||
context.RIL.handleChromeMessage({rilMessageType: "exitEmergencyCbMode"});
|
||||
context.RIL[REQUEST_EXIT_EMERGENCY_CALLBACK_MODE](1, {
|
||||
rilMessageType: "exitEmergencyCbMode",
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
rilMessageType: "exitEmergencyCbMode"
|
||||
});
|
||||
let postedMessage = workerHelper.postedMessage;
|
||||
|
||||
|
|
|
@ -91,7 +91,9 @@ add_test(function test_error_message_update_icc_contact() {
|
|||
|
||||
// Error 6, ICC IO Error.
|
||||
io.loadLinearFixedEF = function(options) {
|
||||
ril[REQUEST_SIM_IO](0, {rilRequestError: ERROR_GENERIC_FAILURE});
|
||||
ril[REQUEST_SIM_IO](0, {
|
||||
errorMsg: GECKO_ERROR_GENERIC_FAILURE
|
||||
});
|
||||
};
|
||||
do_test({contactType: GECKO_CARDCONTACT_TYPE_ADN,
|
||||
contact: {contactId: ICCID + "1"}},
|
||||
|
|
|
@ -72,8 +72,7 @@ add_test(function test_process_icc_io_error() {
|
|||
buf.writeInt32(sw1);
|
||||
buf.writeInt32(sw2);
|
||||
|
||||
context.RIL[REQUEST_SIM_IO](0, {rilRequestError: ERROR_SUCCESS,
|
||||
fileId: 0xffff,
|
||||
context.RIL[REQUEST_SIM_IO](0, {fileId: 0xffff,
|
||||
command: 0xff,
|
||||
onerror: errorCb});
|
||||
|
||||
|
|
|
@ -55,10 +55,7 @@ add_test(function test_sendMMI_short_code() {
|
|||
|
||||
context.RIL.sendUSSD = function fakeSendUSSD(options){
|
||||
ussdOptions = options;
|
||||
context.RIL[REQUEST_SEND_USSD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
|
||||
context.RIL[REQUEST_SEND_USSD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -78,9 +75,7 @@ add_test(function test_sendMMI_change_PIN() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.changeICCPIN = function fakeChangeICCPIN(options) {
|
||||
context.RIL[REQUEST_ENTER_SIM_PIN](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_ENTER_SIM_PIN](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -127,10 +122,8 @@ add_test(function test_sendMMI_change_PIN2() {
|
|||
let worker = workerhelper.worker;
|
||||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.changeICCPIN2 = function fakeChangeICCPIN2(options){
|
||||
context.RIL[REQUEST_ENTER_SIM_PIN2](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL.changeICCPIN2 = function fakeChangeICCPIN2(options) {
|
||||
context.RIL[REQUEST_ENTER_SIM_PIN2](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -177,10 +170,8 @@ add_test(function test_sendMMI_unblock_PIN() {
|
|||
let worker = workerhelper.worker;
|
||||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.enterICCPUK = function fakeEnterICCPUK(options){
|
||||
context.RIL[REQUEST_ENTER_SIM_PUK](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL.enterICCPUK = function fakeEnterICCPUK(options) {
|
||||
context.RIL[REQUEST_ENTER_SIM_PUK](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -227,10 +218,8 @@ add_test(function test_sendMMI_unblock_PIN2() {
|
|||
let worker = workerhelper.worker;
|
||||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.enterICCPUK2 = function fakeEnterICCPUK2(options){
|
||||
context.RIL[REQUEST_ENTER_SIM_PUK2](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL.enterICCPUK2 = function fakeEnterICCPUK2(options) {
|
||||
context.RIL[REQUEST_ENTER_SIM_PUK2](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -278,11 +267,9 @@ add_test(function test_sendMMI_get_IMEI() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
let mmiOptions;
|
||||
|
||||
context.RIL.getIMEI = function getIMEI(options){
|
||||
context.RIL.getIMEI = function getIMEI(options) {
|
||||
mmiOptions = options;
|
||||
context.RIL[REQUEST_SEND_USSD](0, {
|
||||
rilRequestError: ERROR_SUCCESS,
|
||||
});
|
||||
context.RIL[REQUEST_SEND_USSD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.sendMMI({mmi: createMMIOptions("*#", "06")});
|
||||
|
@ -304,7 +291,6 @@ add_test(function test_sendMMI_get_IMEI_error() {
|
|||
context.RIL.getIMEI = function getIMEI(options){
|
||||
mmiOptions = options;
|
||||
context.RIL[REQUEST_SEND_USSD](0, {
|
||||
rilRequestError: ERROR_RADIO_NOT_AVAILABLE,
|
||||
errorMsg: GECKO_ERROR_RADIO_NOT_AVAILABLE
|
||||
});
|
||||
};
|
||||
|
@ -330,10 +316,9 @@ add_test(function test_sendMMI_call_barring_BAIC_interrogation_voice() {
|
|||
};
|
||||
|
||||
context.RIL.queryICCFacilityLock =
|
||||
function fakeQueryICCFacilityLock(options){
|
||||
function fakeQueryICCFacilityLock(options) {
|
||||
context.RIL[REQUEST_QUERY_FACILITY_LOCK](1, {
|
||||
rilMessageType: "sendMMI",
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
rilMessageType: "sendMMI"
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -358,12 +343,11 @@ add_test(function test_sendMMI_call_barring_BAIC_activation() {
|
|||
let mmiOptions;
|
||||
|
||||
context.RIL.setICCFacilityLock =
|
||||
function fakeSetICCFacilityLock(options){
|
||||
function fakeSetICCFacilityLock(options) {
|
||||
mmiOptions = options;
|
||||
context.RIL[REQUEST_SET_FACILITY_LOCK](0, {
|
||||
rilMessageType: "sendMMI",
|
||||
procedure: MMI_PROCEDURE_ACTIVATION,
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
procedure: MMI_PROCEDURE_ACTIVATION
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -386,12 +370,11 @@ add_test(function test_sendMMI_call_barring_BAIC_deactivation() {
|
|||
let mmiOptions;
|
||||
|
||||
context.RIL.setICCFacilityLock =
|
||||
function fakeSetICCFacilityLock(options){
|
||||
function fakeSetICCFacilityLock(options) {
|
||||
mmiOptions = options;
|
||||
context.RIL[REQUEST_SET_FACILITY_LOCK](0, {
|
||||
rilMessageType: "sendMMI",
|
||||
procedure: MMI_PROCEDURE_DEACTIVATION,
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
procedure: MMI_PROCEDURE_DEACTIVATION
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -419,11 +402,9 @@ add_test(function test_sendMMI_USSD() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
let ussdOptions;
|
||||
|
||||
context.RIL.sendUSSD = function fakeSendUSSD(options){
|
||||
context.RIL.sendUSSD = function fakeSendUSSD(options) {
|
||||
ussdOptions = options;
|
||||
context.RIL[REQUEST_SEND_USSD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SEND_USSD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -447,7 +428,6 @@ add_test(function test_sendMMI_USSD_error() {
|
|||
context.RIL.sendUSSD = function fakeSendUSSD(options){
|
||||
ussdOptions = options;
|
||||
context.RIL[REQUEST_SEND_USSD](0, {
|
||||
rilRequestError: ERROR_GENERIC_FAILURE,
|
||||
errorMsg: GECKO_ERROR_GENERIC_FAILURE
|
||||
});
|
||||
};
|
||||
|
@ -471,9 +451,7 @@ function setCallWaitingSuccess(mmi) {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setCallWaiting = function fakeSetCallWaiting(options) {
|
||||
context.RIL[REQUEST_SET_CALL_WAITING](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SET_CALL_WAITING](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -523,9 +501,7 @@ add_test(function test_sendMMI_call_waiting_interrogation() {
|
|||
1, // enabled
|
||||
2 // length
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_WAITING](1, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
|
|
@ -26,9 +26,7 @@ function setCallForwardSuccess(procedure, serviceCode, sia, sib, sic) {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setCallForward = function fakeSetCallForward(options) {
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_SET_CALL_FORWARD](0, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -75,9 +73,7 @@ add_test(function test_sendMMI_call_forwarding_interrogation() {
|
|||
1, // rules.active
|
||||
1 // rulesLength
|
||||
];
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
@ -105,9 +101,7 @@ add_test(function test_sendMMI_call_forwarding_interrogation_no_rules() {
|
|||
};
|
||||
|
||||
context.RIL.queryCallForwardStatus = function fakeQueryCallForward(options) {
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_QUERY_CALL_FORWARD_STATUS](1, {});
|
||||
};
|
||||
|
||||
context.RIL.radioState = GECKO_RADIOSTATE_ENABLED;
|
||||
|
|
|
@ -13,9 +13,7 @@ add_test(function test_setVoicePrivacyMode_success() {
|
|||
let context = worker.ContextPool._contexts[0];
|
||||
|
||||
context.RIL.setVoicePrivacyMode = function fakeSetVoicePrivacyMode(options) {
|
||||
context.RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE](0, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE](0, {});
|
||||
};
|
||||
|
||||
context.RIL.setVoicePrivacyMode({
|
||||
|
@ -36,7 +34,6 @@ add_test(function test_setVoicePrivacyMode_generic_failure() {
|
|||
|
||||
context.RIL.setVoicePrivacyMode = function fakeSetVoicePrivacyMode(options) {
|
||||
context.RIL[REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE](0, {
|
||||
rilRequestError: ERROR_GENERIC_FAILURE,
|
||||
errorMsg: GECKO_ERROR_GENERIC_FAILURE
|
||||
});
|
||||
};
|
||||
|
@ -62,9 +59,7 @@ add_test(function test_queryVoicePrivacyMode_success_enabled_true() {
|
|||
};
|
||||
|
||||
context.RIL.queryVoicePrivacyMode = function fakeQueryVoicePrivacyMode(options) {
|
||||
context.RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryVoicePrivacyMode();
|
||||
|
@ -86,9 +81,7 @@ add_test(function test_queryVoicePrivacyMode_success_enabled_false() {
|
|||
};
|
||||
|
||||
context.RIL.queryVoicePrivacyMode = function fakeQueryVoicePrivacyMode(options) {
|
||||
context.RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE](1, {
|
||||
rilRequestError: ERROR_SUCCESS
|
||||
});
|
||||
context.RIL[REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE](1, {});
|
||||
};
|
||||
|
||||
context.RIL.queryVoicePrivacyMode();
|
||||
|
|
Загрузка…
Ссылка в новой задаче