Bug 761732 - B2G RIL: rename {handle|send}DOMMessage in ril_worker.js. r=vyang

This commit is contained in:
Jessica Jong 2013-07-23 16:29:55 +08:00
Родитель b140300da4
Коммит 026bc7fee0
1 изменённых файлов: 104 добавлений и 104 удалений

Просмотреть файл

@ -994,7 +994,7 @@ let RIL = {
default:
options.errorMsg = "Unsupported Card Lock.";
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}
},
@ -1064,7 +1064,7 @@ let RIL = {
default:
options.errorMsg = "Unsupported Card Lock.";
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}
} else { // Enable/Disable lock.
switch (options.lockType) {
@ -1079,7 +1079,7 @@ let RIL = {
default:
options.errorMsg = "Unsupported Card Lock.";
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
options.enabled = options.enabled;
@ -1187,7 +1187,7 @@ let RIL = {
default:
options.errorMsg = "Unsupported Card Lock.";
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -1219,7 +1219,7 @@ let RIL = {
/* unknown lock type */
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -1231,7 +1231,7 @@ let RIL = {
/* ... while the phones do not. */
options.errorMsg = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
options.success = false;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}
},
@ -1383,7 +1383,7 @@ let RIL = {
if (!this.appType) {
options.rilMessageType = "icccontacts";
options.errorMsg = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}
ICCContactHelper.readICCContacts(
@ -1393,12 +1393,12 @@ let RIL = {
// Reuse 'options' to get 'requestId' and 'contactType'.
options.rilMessageType = "icccontacts";
options.contacts = contacts;
RIL.sendDOMMessage(options);
RIL.sendChromeMessage(options);
}.bind(this),
function onerror(errorMsg) {
options.rilMessageType = "icccontacts";
options.errorMsg = errorMsg;
RIL.sendDOMMessage(options);
RIL.sendChromeMessage(options);
}.bind(this));
},
@ -1414,13 +1414,13 @@ let RIL = {
let onsuccess = function onsuccess() {
// Reuse 'options' to get 'requestId' and 'contactType'.
options.rilMessageType = "icccontactupdate";
RIL.sendDOMMessage(options);
RIL.sendChromeMessage(options);
}.bind(this);
let onerror = function onerror(errorMsg) {
options.rilMessageType = "icccontactupdate";
options.errorMsg = errorMsg;
RIL.sendDOMMessage(options);
RIL.sendChromeMessage(options);
}.bind(this);
if (!this.appType || !options.contact) {
@ -1736,7 +1736,7 @@ let RIL = {
options.callIndex = -1;
options.rilMessageType = "callError";
options.errorMsg = errorMsg;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}).bind(this);
if (this._isEmergencyNumber(options.number)) {
@ -1777,7 +1777,7 @@ let RIL = {
this.cachedDialRequest.callback = this.sendDialRequest.bind(this, options);
// Change radio setting value in settings DB to enable radio.
this.sendDOMMessage({rilMessageType: "setRadioEnabled", on: true});
this.sendChromeMessage({rilMessageType: "setRadioEnabled", on: true});
return;
}
@ -2012,7 +2012,7 @@ let RIL = {
debug("Invalid Cell Broadcast search list: " + e);
}
options.rilRequestError = ERROR_GENERIC_FAILURE;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -2159,7 +2159,7 @@ let RIL = {
Buf.sendParcel();
datacall.state = GECKO_NETWORK_STATE_DISCONNECTING;
this.sendDOMMessage(datacall);
this.sendChromeMessage(datacall);
},
/**
@ -2316,7 +2316,7 @@ let RIL = {
if (mmiServiceCode) {
options.mmiServiceCode = mmiServiceCode;
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}).bind(this);
function _isValidPINPUKRequest(mmiServiceCode) {
@ -2486,11 +2486,11 @@ let RIL = {
this.getIMEI({mmi: true});
return;
}
// If we already had the device's IMEI, we just send it to the DOM.
// If we already had the device's IMEI, we just send it to chrome.
options.mmiServiceCode = MMI_KS_SC_IMEI;
options.success = true;
options.statusMessage = this.IMEI;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
// CLIP
@ -3134,8 +3134,8 @@ let RIL = {
return;
}
this.cardState = newCardState;
this.sendDOMMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
this.sendChromeMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
return;
}
@ -3149,8 +3149,8 @@ let RIL = {
}
this.operator = null;
this.cardState = GECKO_CARDSTATE_UNKNOWN;
this.sendDOMMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
this.sendChromeMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
return;
}
// fetchICCRecords will need to read aid, so read aid here.
@ -3201,8 +3201,8 @@ let RIL = {
}
this.cardState = newCardState;
this.sendDOMMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
this.sendChromeMessage({rilMessageType: "cardstatechange",
cardState: this.cardState});
},
/**
@ -3216,7 +3216,7 @@ let RIL = {
}
options.retryCount = length ? Buf.readUint32List()[0] : -1;
if (options.rilMessageType != "sendMMI") {
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -3258,7 +3258,7 @@ let RIL = {
}
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
},
// We combine all of the NETWORK_INFO_MESSAGE_TYPES into one "networkinfochange"
@ -3284,7 +3284,7 @@ let RIL = {
if (!this._processingNetworkInfo) {
// We only combine these messages in the case of the combined request
// in requestNetworkInfo()
this.sendDOMMessage(message);
this.sendChromeMessage(message);
return;
}
@ -3332,7 +3332,7 @@ let RIL = {
},
_sendPendingNetworkInfo: function _sendPendingNetworkInfo() {
RIL.sendDOMMessage(RIL._pendingNetworkInfo);
RIL.sendChromeMessage(RIL._pendingNetworkInfo);
RIL._processingNetworkInfo = false;
for (let i = 0; i < NETWORK_INFO_MESSAGE_TYPES.length; i++) {
@ -3538,7 +3538,7 @@ let RIL = {
// State has changed.
if (newCall.state == CALL_STATE_INCOMING &&
currentCall.state == CALL_STATE_WAITING) {
// Update the call internally but we don't notify DOM since these two
// Update the call internally but we don't notify chrome since these two
// states are viewed as the same one there.
currentCall.state = newCall.state;
continue;
@ -3588,13 +3588,13 @@ let RIL = {
_handleChangedCallState: function _handleChangedCallState(changedCall) {
let message = {rilMessageType: "callStateChange",
call: changedCall};
this.sendDOMMessage(message);
this.sendChromeMessage(message);
},
_handleDisconnectedCall: function _handleDisconnectedCall(disconnectedCall) {
let message = {rilMessageType: "callDisconnected",
call: disconnectedCall};
this.sendDOMMessage(message);
this.sendChromeMessage(message);
},
_sendDataCallError: function _sendDataCallError(message, errorCode) {
@ -3604,7 +3604,7 @@ let RIL = {
} else {
message.errorMsg = RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[errorCode];
}
this.sendDOMMessage(message);
this.sendChromeMessage(message);
},
_processDataCallList: function _processDataCallList(datacalls, newDataCallOptions) {
@ -3632,7 +3632,7 @@ let RIL = {
if (!newDataCallOptions) {
currentDataCall.state = GECKO_NETWORK_STATE_DISCONNECTED;
currentDataCall.rilMessageType = "datacallstatechange";
this.sendDOMMessage(currentDataCall);
this.sendChromeMessage(currentDataCall);
}
continue;
}
@ -3641,7 +3641,7 @@ let RIL = {
delete this.currentDataCalls[currentDataCall.cid];
currentDataCall.state = GECKO_NETWORK_STATE_UNKNOWN;
currentDataCall.rilMessageType = "datacallstatechange";
this.sendDOMMessage(currentDataCall);
this.sendChromeMessage(currentDataCall);
continue;
}
@ -3651,7 +3651,7 @@ let RIL = {
currentDataCall.active = updatedDataCall.active;
currentDataCall.state = updatedDataCall.state;
currentDataCall.rilMessageType = "datacallstatechange";
this.sendDOMMessage(currentDataCall);
this.sendChromeMessage(currentDataCall);
}
}
@ -3673,7 +3673,7 @@ let RIL = {
debug("Unexpected new data call: " + JSON.stringify(newDataCall));
}
newDataCall.rilMessageType = "datacallstatechange";
this.sendDOMMessage(newDataCall);
this.sendChromeMessage(newDataCall);
}
},
@ -4019,7 +4019,7 @@ let RIL = {
message.result = PDU_FCS_RESERVED;
}
message.rilMessageType = "sms-received";
this.sendDOMMessage(message);
this.sendChromeMessage(message);
// We will acknowledge receipt of the SMS after we try to store it
// in the database.
@ -4078,7 +4078,7 @@ let RIL = {
let deliveryStatus = ((status >>> 5) === 0x00)
? GECKO_SMS_DELIVERY_STATUS_SUCCESS
: GECKO_SMS_DELIVERY_STATUS_ERROR;
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "sms-delivery",
envelopeId: options.envelopeId,
deliveryStatus: deliveryStatus
@ -4195,7 +4195,7 @@ let RIL = {
// Fallback to default error handling if it meets max retry count.
// Fall through.
default:
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "sms-send-failed",
envelopeId: options.envelopeId,
errorMsg: options.rilRequestError,
@ -4220,7 +4220,7 @@ let RIL = {
this._pendingSentSmsMap[options.messageRef] = options;
}
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "sms-sent",
envelopeId: options.envelopeId,
});
@ -4510,8 +4510,8 @@ let RIL = {
* @param message
* Object containing the message. Messages are supposed
*/
handleDOMMessage: function handleMessage(message) {
if (DEBUG) debug("Received DOM message " + JSON.stringify(message));
handleChromeMessage: function handleChromeMessage(message) {
if (DEBUG) debug("Received chrome message " + JSON.stringify(message));
let method = this[message.rilMessageType];
if (typeof method != "function") {
if (DEBUG) {
@ -4532,7 +4532,7 @@ let RIL = {
calls.push(call);
}
options.calls = calls;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
},
/**
@ -4543,8 +4543,8 @@ let RIL = {
for each (let datacall in this.currentDataCalls) {
datacall_list.push(datacall);
}
this.sendDOMMessage({rilMessageType: "datacalllist",
datacalls: datacall_list});
this.sendChromeMessage({rilMessageType: "datacalllist",
datacalls: datacall_list});
},
/**
@ -4571,7 +4571,7 @@ let RIL = {
" commandQualifier = " + cmdDetails.commandQualifier);
}
// STK_CMD_MORE_TIME need not to propagate event to DOM.
// STK_CMD_MORE_TIME need not to propagate event to chrome.
if (cmdDetails.typeOfCommand == STK_CMD_MORE_TIME) {
RIL.sendStkTerminalResponse({
command: cmdDetails,
@ -4581,13 +4581,13 @@ let RIL = {
cmdDetails.rilMessageType = "stkcommand";
cmdDetails.options = StkCommandParamsFactory.createParam(cmdDetails, ctlvs);
RIL.sendDOMMessage(cmdDetails);
RIL.sendChromeMessage(cmdDetails);
},
/**
* Send messages to the main thread.
*/
sendDOMMessage: function sendDOMMessage(message) {
sendChromeMessage: function sendChromeMessage(message) {
postMessage(message);
},
@ -4754,7 +4754,7 @@ RIL[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) {
options.rilMessageType = "iccimsi";
options.imsi = this.iccInfoPrivate.imsi;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
if (this._isCdma) {
let mccMnc = ICCUtilsHelper.parseMccMncFromImsi(this.iccInfoPrivate.imsi);
@ -4825,7 +4825,7 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length
default:
options.rilMessageType = "callError";
options.errorMsg = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
break;
}
};
@ -4890,7 +4890,7 @@ RIL[REQUEST_SIGNAL_STRENGTH] = function REQUEST_SIGNAL_STRENGTH(length, options)
if (DEBUG) debug("Signal strength " + JSON.stringify(obj));
obj.rilMessageType = "signalstrengthchange";
this.sendDOMMessage(obj);
this.sendChromeMessage(obj);
if (this.cachedDialRequest && obj.gsmDBM && obj.gsmRelative) {
// Radio is ready for making the cached emergency call.
@ -4979,7 +4979,7 @@ RIL[REQUEST_SETUP_DATA_CALL] = function REQUEST_SETUP_DATA_CALL(length, options)
this.readSetupDataCall_v5(options);
this.currentDataCalls[options.cid] = options;
options.rilMessageType = "datacallstatechange";
this.sendDOMMessage(options);
this.sendChromeMessage(options);
// Let's get the list of data calls to ensure we know whether it's active
// or not.
this.getDataCallList();
@ -5011,7 +5011,7 @@ RIL[REQUEST_SEND_USSD] = function REQUEST_SEND_USSD(length, options) {
}
options.success = (this._ussdSession = options.rilRequestError === 0);
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, options) {
if (DEBUG) {
@ -5020,13 +5020,13 @@ RIL[REQUEST_CANCEL_USSD] = function REQUEST_CANCEL_USSD(length, options) {
options.success = (options.rilRequestError === 0);
this._ussdSession = !options.success;
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5034,7 +5034,7 @@ RIL[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) {
if (!bufLength || bufLength < 2) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5104,7 +5104,7 @@ RIL[REQUEST_GET_CLIR] = function REQUEST_GET_CLIR(length, options) {
}
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CLIR] = function REQUEST_SET_CLIR(length, options) {
options.success = (options.rilRequestError === 0);
@ -5121,7 +5121,7 @@ RIL[REQUEST_SET_CLIR] = function REQUEST_SET_CLIR(length, options) {
break;
}
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] =
@ -5129,7 +5129,7 @@ RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] =
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5140,7 +5140,7 @@ RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] =
if (!rulesLength) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
let rules = new Array(rulesLength);
@ -5162,7 +5162,7 @@ RIL[REQUEST_QUERY_CALL_FORWARD_STATUS] =
// instances.
options.additionalInformation = rules;
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CALL_FORWARD] =
function REQUEST_SET_CALL_FORWARD(length, options) {
@ -5186,20 +5186,20 @@ RIL[REQUEST_SET_CALL_FORWARD] =
break;
}
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_CALL_WAITING] =
function REQUEST_QUERY_CALL_WAITING(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
options.length = Buf.readUint32();
options.enabled = ((Buf.readUint32() == 1) &&
((Buf.readUint32() & ICC_SERVICE_CLASS_VOICE) == 0x01));
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_CALL_WAITING] = function REQUEST_SET_CALL_WAITING(length, options) {
@ -5207,12 +5207,12 @@ RIL[REQUEST_SET_CALL_WAITING] = function REQUEST_SET_CALL_WAITING(length, option
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SMS_ACKNOWLEDGE] = null;
RIL[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, options) {
this.IMEI = Buf.readString();
// So far we only send the IMEI back to the DOM if it was requested via MMI.
// So far we only send the IMEI back to chrome if it was requested via MMI.
if (!options.mmi) {
return;
}
@ -5225,7 +5225,7 @@ RIL[REQUEST_GET_IMEI] = function REQUEST_GET_IMEI(length, options) {
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
}
options.statusMessage = this.IMEI;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_GET_IMEISV] = function REQUEST_GET_IMEISV(length, options) {
if (options.rilRequestError) {
@ -5244,7 +5244,7 @@ RIL[REQUEST_DEACTIVATE_DATA_CALL] = function REQUEST_DEACTIVATE_DATA_CALL(length
delete this.currentDataCalls[options.cid];
datacall.state = GECKO_NETWORK_STATE_UNKNOWN;
datacall.rilMessageType = "datacallstatechange";
this.sendDOMMessage(datacall);
this.sendChromeMessage(datacall);
};
RIL[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILITY_LOCK(length, options) {
options.success = (options.rilRequestError === 0);
@ -5255,7 +5255,7 @@ RIL[REQUEST_QUERY_FACILITY_LOCK] = function REQUEST_QUERY_FACILITY_LOCK(length,
if (length) {
options.enabled = Buf.readUint32List()[0] === 0 ? false : true;
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_FACILITY_LOCK] = function REQUEST_SET_FACILITY_LOCK(length, options) {
options.success = (options.rilRequestError === 0);
@ -5263,34 +5263,34 @@ RIL[REQUEST_SET_FACILITY_LOCK] = function REQUEST_SET_FACILITY_LOCK(length, opti
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
options.retryCount = length ? Buf.readUint32List()[0] : -1;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_CHANGE_BARRING_PASSWORD] = null;
RIL[REQUEST_SIM_OPEN_CHANNEL] = function REQUEST_SIM_OPEN_CHANNEL(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
options.channel = Buf.readUint32();
if (DEBUG) debug("Setting channel number in options: " + options.channel);
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SIM_CLOSE_CHANNEL] = function REQUEST_SIM_CLOSE_CHANNEL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
// No return value
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SIM_ACCESS_CHANNEL] = function REQUEST_SIM_ACCESS_CHANNEL(length, options) {
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
}
options.sw1 = Buf.readUint32();
@ -5300,14 +5300,14 @@ RIL[REQUEST_SIM_ACCESS_CHANNEL] = function REQUEST_SIM_ACCESS_CHANNEL(length, op
debug("Setting return values for RIL[REQUEST_SIM_ACCESS_CHANNEL]: ["
+ options.sw1 + "," + options.sw2 + ", " + options.simResponse + "]");
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUERY_NETWORK_SELECTION_MODE(length, options) {
this._receivedNetworkInfo(NETWORK_INFO_NETWORK_SELECTION_MODE);
if (options.rilRequestError) {
options.error = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5335,30 +5335,30 @@ RIL[REQUEST_QUERY_NETWORK_SELECTION_MODE] = function REQUEST_QUERY_NETWORK_SELEC
RIL[REQUEST_SET_NETWORK_SELECTION_AUTOMATIC] = function REQUEST_SET_NETWORK_SELECTION_AUTOMATIC(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_SET_NETWORK_SELECTION_MANUAL] = function REQUEST_SET_NETWORK_SELECTION_MANUAL(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_QUERY_AVAILABLE_NETWORKS] = function REQUEST_QUERY_AVAILABLE_NETWORKS(length, options) {
if (options.rilRequestError) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
options.networks = this._processNetworks();
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_DTMF_START] = null;
RIL[REQUEST_DTMF_STOP] = null;
@ -5377,7 +5377,7 @@ RIL[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, options) {
options.success = (options.rilRequestError === 0);
if (!options.success) {
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5385,7 +5385,7 @@ RIL[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, options) {
if (!bufLength) {
options.success = false;
options.errorMsg = GECKO_ERROR_GENERIC_FAILURE;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
return;
}
@ -5409,7 +5409,7 @@ RIL[REQUEST_QUERY_CLIP] = function REQUEST_QUERY_CLIP(length, options) {
break;
}
}
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[REQUEST_LAST_DATA_CALL_FAIL_CAUSE] = null;
@ -5525,7 +5525,7 @@ RIL[REQUEST_SET_PREFERRED_NETWORK_TYPE] = function REQUEST_SET_PREFERRED_NETWORK
return;
}
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "setPreferredNetworkType",
networkType: options.networkType,
success: options.rilRequestError == ERROR_SUCCESS
@ -5541,7 +5541,7 @@ RIL[REQUEST_GET_PREFERRED_NETWORK_TYPE] = function REQUEST_GET_PREFERRED_NETWORK
}
}
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "getPreferredNetworkType",
networkType: networkType,
success: options.rilRequestError == ERROR_SUCCESS
@ -5643,7 +5643,7 @@ RIL[REQUEST_GET_UNLOCK_RETRY_COUNT] = function REQUEST_GET_UNLOCK_RETRY_COUNT(le
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
}
options.retryCount = length ? Buf.readUint32List()[0] : -1;
this.sendDOMMessage(options);
this.sendChromeMessage(options);
};
RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED() {
let radioState = Buf.readUint32();
@ -5714,7 +5714,7 @@ RIL[UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED] = function UNSOLICITED_RESPONSE_RA
}
this.radioState = newState;
this.sendDOMMessage({
this.sendChromeMessage({
rilMessageType: "radiostatechange",
radioState: newState
});
@ -5767,9 +5767,9 @@ RIL[UNSOLICITED_ON_USSD] = function UNSOLICITED_ON_USSD() {
this._ussdSession = (typeCode != "0" && typeCode != "2");
this.sendDOMMessage({rilMessageType: "USSDReceived",
message: message,
sessionEnded: !this._ussdSession});
this.sendChromeMessage({rilMessageType: "USSDReceived",
message: message,
sessionEnded: !this._ussdSession});
};
RIL[UNSOLICITED_NITZ_TIME_RECEIVED] = function UNSOLICITED_NITZ_TIME_RECEIVED() {
let dateString = Buf.readString();
@ -5805,11 +5805,11 @@ RIL[UNSOLICITED_NITZ_TIME_RECEIVED] = function UNSOLICITED_NITZ_TIME_RECEIVED()
return;
}
this.sendDOMMessage({rilMessageType: "nitzTime",
networkTimeInMS: timeInMS,
networkTimeZoneInMinutes: -(tz * 15),
networkDSTInMinutes: -(dst * 60),
receiveTimeInMS: now});
this.sendChromeMessage({rilMessageType: "nitzTime",
networkTimeInMS: timeInMS,
networkTimeZoneInMinutes: -(tz * 15),
networkDSTInMinutes: -(dst * 60),
receiveTimeInMS: now});
};
RIL[UNSOLICITED_SIGNAL_STRENGTH] = function UNSOLICITED_SIGNAL_STRENGTH(length) {
@ -5825,7 +5825,7 @@ RIL[UNSOLICITED_DATA_CALL_LIST_CHANGED] = function UNSOLICITED_DATA_CALL_LIST_CH
RIL[UNSOLICITED_SUPP_SVC_NOTIFICATION] = null;
RIL[UNSOLICITED_STK_SESSION_END] = function UNSOLICITED_STK_SESSION_END() {
this.sendDOMMessage({rilMessageType: "stksessionend"});
this.sendChromeMessage({rilMessageType: "stksessionend"});
};
RIL[UNSOLICITED_STK_PROACTIVE_COMMAND] = function UNSOLICITED_STK_PROACTIVE_COMMAND() {
this.processStkProactiveCommand();
@ -5849,7 +5849,7 @@ RIL[UNSOLICITED_CALL_RING] = function UNSOLICITED_CALL_RING() {
// call, but that's enough to bring up the Phone app already. We'll know
// details once we get a call state changed notification and can then
// dispatch DOM events etc.
this.sendDOMMessage(info);
this.sendChromeMessage(info);
};
RIL[UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED] = function UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED() {
this.getICCStatus();
@ -5885,7 +5885,7 @@ RIL[UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS] = function UNSOLICITED_RESPONSE_NEW_
}
message.rilMessageType = "cellbroadcast-received";
this.sendDOMMessage(message);
this.sendChromeMessage(message);
};
RIL[UNSOLICITED_CDMA_RUIM_SMS_STORAGE_FULL] = null;
RIL[UNSOLICITED_RESTRICTED_STATE_CHANGED] = null;
@ -10823,7 +10823,7 @@ let ICCRecordHelper = {
debug("MBDN, alphaId="+contact.alphaId+" number="+contact.number);
}
contact.rilMessageType = "iccmbdn";
RIL.sendDOMMessage(contact);
RIL.sendChromeMessage(contact);
}
ICCIOHelper.loadLinearFixedEF({fileId: ICC_EF_MBDN,
@ -11804,7 +11804,7 @@ let ICCUtilsHelper = {
*/
handleICCInfoChange: function handleICCInfoChange() {
RIL.iccInfo.rilMessageType = "iccinfochange";
RIL.sendDOMMessage(RIL.iccInfo);
RIL.sendChromeMessage(RIL.iccInfo);
},
/**
@ -12615,7 +12615,7 @@ function onRILMessage(data) {
}
onmessage = function onmessage(event) {
RIL.handleDOMMessage(event.data);
RIL.handleChromeMessage(event.data);
};
onerror = function onerror(event) {