☠☠ backed out by 06aa6175c28b ☠ ☠ | |
author | Yoshi Huang <yhuang@mozilla.com> |
Wed, 13 Jun 2012 10:46:41 +0800 | |
changeset 101788 | 421ed10b0e817c04dd6aef4611fc4027b15b5aa0 |
parent 101787 | ddf9d7173d720d721705a05a7062a85bebebcfa5 |
child 101789 | 4180a4a2ebf2da0195b8899170e164b7d2d82112 |
push id | 1316 |
push user | akeybl@mozilla.com |
push date | Mon, 27 Aug 2012 22:37:00 +0000 |
treeherder | mozilla-beta@db4b09302ee2 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | philikon |
bugs | 767620 |
milestone | 16.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/sms/src/ril/SmsDatabaseService.js +++ b/dom/sms/src/ril/SmsDatabaseService.js @@ -344,26 +344,26 @@ SmsDatabaseService.prototype = { /** * nsISmsDatabaseService API */ saveReceivedMessage: function saveReceivedMessage(sender, body, date) { let message = {delivery: DELIVERY_RECEIVED, sender: sender, - receiver: this.mRIL.radioState.msisdn, + receiver: this.mRIL.rilContext.icc.msisdn, body: body, timestamp: date, read: FILTER_READ_UNREAD}; return this.saveMessage(message); }, saveSentMessage: function saveSentMessage(receiver, body, date) { let message = {delivery: DELIVERY_SENT, - sender: this.mRIL.radioState.msisdn, + sender: this.mRIL.rilContext.icc.msisdn, receiver: receiver, body: body, timestamp: date, read: FILTER_READ_READ}; return this.saveMessage(message); }, getMessage: function getMessage(messageId, requestId) {
--- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -25,17 +25,17 @@ const nsIRadioInterfaceLayer = Ci.nsIRad const kNetworkInterfaceStateChangedTopic = "network-interface-state-changed"; const kSmsReceivedObserverTopic = "sms-received"; const kSmsDeliveredObserverTopic = "sms-delivered"; const kMozSettingsChangedObserverTopic = "mozsettings-changed"; const DOM_SMS_DELIVERY_RECEIVED = "received"; const DOM_SMS_DELIVERY_SENT = "sent"; const RIL_IPC_MSG_NAMES = [ - "RIL:GetRadioState", + "RIL:GetRilContext", "RIL:EnumerateCalls", "RIL:GetMicrophoneMuted", "RIL:SetMicrophoneMuted", "RIL:GetSpeakerEnabled", "RIL:SetSpeakerEnabled", "RIL:StartTone", "RIL:StopTone", "RIL:Dial", @@ -141,32 +141,32 @@ DataCallInfo.protoptype = { function RadioInterfaceLayer() { debug("Starting RIL Worker"); this.worker = new ChromeWorker("resource://gre/modules/ril_worker.js"); this.worker.onerror = this.onerror.bind(this); this.worker.onmessage = this.onmessage.bind(this); - this.radioState = { + this.rilContext = { radioState: RIL.GECKO_RADIOSTATE_UNAVAILABLE, cardState: RIL.GECKO_CARDSTATE_UNAVAILABLE, icc: null, cell: null, // These objects implement the nsIDOMMozMobileConnectionInfo interface, // although the actual implementation lives in the content process. voice: {connected: false, emergencyCallsOnly: false, roaming: false, network: null, type: null, signalStrength: null, relSignalStrength: null}, - data: {connected: false, + data: {connected: false, emergencyCallsOnly: false, roaming: false, network: null, type: null, signalStrength: null, relSignalStrength: null}, }; @@ -199,19 +199,19 @@ RadioInterfaceLayer.prototype = { Ci.nsISettingsServiceCallback]), /** * Process a message from the content process. */ receiveMessage: function receiveMessage(msg) { debug("Received '" + msg.name + "' message from content process"); switch (msg.name) { - case "RIL:GetRadioState": + case "RIL:GetRilContext": // This message is sync. - return this.radioState; + return this.rilContext; case "RIL:EnumerateCalls": this.enumerateCalls(); break; case "RIL:GetMicrophoneMuted": // This message is sync. return this.microphoneMuted; case "RIL:SetMicrophoneMuted": this.microphoneMuted = msg.json; @@ -319,17 +319,17 @@ RadioInterfaceLayer.prototype = { break; case "operatorchange": this.handleOperatorChange(message); break; case "radiostatechange": this.handleRadioStateChange(message); break; case "cardstatechange": - this.radioState.cardState = message.cardState; + this.rilContext.cardState = message.cardState; ppmm.sendAsyncMessage("RIL:CardStateChanged", message); break; case "sms-received": this.handleSmsReceived(message); return; case "sms-sent": this.handleSmsSent(message); return; @@ -354,17 +354,17 @@ RadioInterfaceLayer.prototype = { // sent from the network and a timestamp of when the message was received // so an offset can be added if/when the time is actually set. debug("nitzTime networkTime=" + message.networkTimeInSeconds + " timezone=" + message.networkTimeZoneInMinutes + " dst=" + message.dstFlag + " timestamp=" + message.localTimeStampInMS); break; case "iccinfochange": - this.radioState.icc = message; + this.rilContext.icc = message; break; case "iccgetcardlock": this.handleICCGetCardLock(message); break; case "iccsetcardlock": this.handleICCSetCardLock(message); break; case "iccunlockcardlock": @@ -376,17 +376,17 @@ RadioInterfaceLayer.prototype = { } let callback = this._contactsCallbacks[message.requestId]; if (callback) { delete this._contactsCallbacks[message.requestId]; callback.receiveContactsList(message.contactType, message.contacts); } break; case "celllocationchanged": - this.radioState.cell = message; + this.rilContext.cell = message; break; case "ussdreceived": debug("ussdreceived " + JSON.stringify(message)); this.handleUSSDReceived(message); break; case "sendussd": this.handleSendUSSD(message); break; @@ -394,17 +394,17 @@ RadioInterfaceLayer.prototype = { this.handleCancelUSSD(message); break; default: throw new Error("Don't know about this message type: " + message.type); } }, updateVoiceConnection: function updateVoiceConnection(state) { - let voiceInfo = this.radioState.voice; + let voiceInfo = this.rilContext.voice; voiceInfo.type = "gsm"; //TODO see bug 726098. if (!state || state.regState == RIL.NETWORK_CREG_STATE_UNKNOWN) { voiceInfo.connected = false; voiceInfo.emergencyCallsOnly = false; voiceInfo.roaming = false; voiceInfo.network = null; voiceInfo.type = null; voiceInfo.signalStrength = null; @@ -461,78 +461,78 @@ RadioInterfaceLayer.prototype = { } //TODO need to keep track of some of the state information, and then // notify the content when state changes (connected, technology // changes, etc.). This should be done in RILNetworkInterface. }, handleSignalStrengthChange: function handleSignalStrengthChange(message) { // TODO CDMA, EVDO, LTE, etc. (see bug 726098) - this.radioState.voice.signalStrength = message.gsmDBM; - this.radioState.voice.relSignalStrength = message.gsmRelative; - ppmm.sendAsyncMessage("RIL:VoiceInfoChanged", this.radioState.voice); + this.rilContext.voice.signalStrength = message.gsmDBM; + this.rilContext.voice.relSignalStrength = message.gsmRelative; + ppmm.sendAsyncMessage("RIL:VoiceInfoChanged", this.rilContext.voice); - this.radioState.data.signalStrength = message.gsmDBM; - this.radioState.data.relSignalStrength = message.gsmRelative; - ppmm.sendAsyncMessage("RIL:DataInfoChanged", this.radioState.data); + this.rilContext.data.signalStrength = message.gsmDBM; + this.rilContext.data.relSignalStrength = message.gsmRelative; + ppmm.sendAsyncMessage("RIL:DataInfoChanged", this.rilContext.data); }, networkChanged: function networkChanged(srcNetwork, destNetwork) { return !destNetwork || destNetwork.longName != srcNetwork.longName || destNetwork.shortName != srcNetwork.shortName || destNetwork.mnc != srcNetwork.mnc || destNetwork.mcc != srcNetwork.mcc; }, handleOperatorChange: function handleOperatorChange(message) { - let voice = this.radioState.voice; - let data = this.radioState.data; + let voice = this.rilContext.voice; + let data = this.rilContext.data; if (this.networkChanged(message, voice.network)) { voice.network = message; ppmm.sendAsyncMessage("RIL:VoiceInfoChanged", voice); } if (this.networkChanged(message, data.network)) { data.network = message; ppmm.sendAsyncMessage("RIL:DataInfoChanged", data); } }, handleRadioStateChange: function handleRadioStateChange(message) { let newState = message.radioState; - if (this.radioState.radioState == newState) { + if (this.rilContext.radioState == newState) { return; } - this.radioState.radioState = newState; + this.rilContext.radioState = newState; //TODO Should we notify this change as a card state change? this._ensureRadioState(); }, _ensureRadioState: function _ensureRadioState() { - debug("Reported radio state is " + this.radioState.radioState + + debug("Reported radio state is " + this.rilContext.radioState + ", desired radio enabled state is " + this._radioEnabled); if (this._radioEnabled == null) { // We haven't read the initial value from the settings DB yet. // Wait for that. return; } - if (this.radioState.radioState == RIL.GECKO_RADIOSTATE_UNKNOWN) { + if (this.rilContext.radioState == RIL.GECKO_RADIOSTATE_UNKNOWN) { // We haven't received a radio state notification from the RIL // yet. Wait for that. return; } - if (this.radioState.radioState == RIL.GECKO_RADIOSTATE_OFF && + if (this.rilContext.radioState == RIL.GECKO_RADIOSTATE_OFF && this._radioEnabled) { this.setRadioEnabled(true); } - if (this.radioState.radioState == RIL.GECKO_RADIOSTATE_READY && + if (this.rilContext.radioState == RIL.GECKO_RADIOSTATE_READY && !this._radioEnabled) { this.setRadioEnabled(false); } }, /** * Track the active call and update the audio system as its state changes. */ @@ -632,17 +632,17 @@ RadioInterfaceLayer.prototype = { debug("Got port addressed SMS but not encoded in 8-bit alphabet. Drop!"); return; } let options = { bearer: WAP.WDP_BEARER_GSM_SMS_GSM_MSISDN, sourceAddress: message.sender, sourcePort: message.header.originatorPort, - destinationAddress: this.radioState.icc.MSISDN, + destinationAddress: this.rilContext.icc.msisdn, destinationPort: message.header.destinationPort, }; WAP.WapPushManager.receiveWdpPDU(message.fullData, message.fullData.length, 0, options); }, portAddressedSmsApps: null, handleSmsReceived: function handleSmsReceived(message) { @@ -885,17 +885,17 @@ RadioInterfaceLayer.prototype = { // nsIRadioInterfaceLayer setRadioEnabled: function setRadioEnabled(value) { debug("Setting radio power to " + value); this.worker.postMessage({type: "setRadioPower", on: value}); }, - radioState: null, + rilContext: null, // Handle phone functions of nsIRILContentHelper enumerateCalls: function enumerateCalls() { debug("Requesting enumeration of calls for callback"); this.worker.postMessage({type: "enumerateCalls"}); },
--- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -995,21 +995,21 @@ let RIL = { PDU_HEX_OCTET_SIZE); // Dialling Number/SSC String let len = GsmPDUHelper.readHexOctet(); if (len > MSISDN_MAX_NUMBER_SIZE_BYTES) { debug("ICC_EF_MSISDN: invalid length of BCD number/SSC contents - " + len); return; } - this.iccInfo.MSISDN = GsmPDUHelper.readDiallingNumber(len); + this.iccInfo.msisdn = GsmPDUHelper.readDiallingNumber(len); Buf.readStringDelimiter(length); - if (DEBUG) debug("MSISDN: " + this.iccInfo.MSISDN); - if (this.iccInfo.MSISDN) { + if (DEBUG) debug("MSISDN: " + this.iccInfo.msisdn); + if (this.iccInfo.msisdn) { this._handleICCInfoChange(); } } this.iccIO({ command: ICC_COMMAND_GET_RESPONSE, fileId: ICC_EF_MSISDN, pathId: EF_PATH_MF_SIM + EF_PATH_DF_TELECOM, @@ -1019,40 +1019,40 @@ let RIL = { data: null, pin2: null, type: EF_TYPE_LINEAR_FIXED, callback: callback, }); }, /** - * Read the AD from the ICC. + * Read the AD (Administrative Data) from the ICC. */ getAD: function getAD() { function callback() { let length = Buf.readUint32(); // Each octet is encoded into two chars. let len = length / 2; - this.iccInfo.AD = GsmPDUHelper.readHexOctetArray(len); + this.iccInfo.ad = GsmPDUHelper.readHexOctetArray(len); Buf.readStringDelimiter(length); if (DEBUG) { let str = ""; - for (let i = 0; i < this.iccInfo.AD.length; i++) { - str += this.iccInfo.AD[i] + ", "; + for (let i = 0; i < this.iccInfo.ad.length; i++) { + str += this.iccInfo.ad[i] + ", "; } debug("AD: " + str); } - if (this.iccInfo.IMSI) { + if (this.iccInfo.imsi) { // MCC is the first 3 digits of IMSI - this.iccInfo.MCC = this.iccInfo.IMSI.substr(0,3); + this.iccInfo.mcc = parseInt(this.iccInfo.imsi.substr(0,3)); // The 4th byte of the response is the length of MNC - this.iccInfo.MNC = this.iccInfo.IMSI.substr(3, this.iccInfo.AD[3]); - if (DEBUG) debug("MCC: " + this.iccInfo.MCC + " MNC: " + this.iccInfo.MNC); + this.iccInfo.mnc = parseInt(this.iccInfo.imsi.substr(3, this.iccInfo.ad[3])); + if (DEBUG) debug("MCC: " + this.iccInfo.mcc + " MNC: " + this.iccInfo.mnc); this._handleICCInfoChange(); } } this.iccIO({ command: ICC_COMMAND_GET_RESPONSE, fileId: ICC_EF_AD, pathId: EF_PATH_MF_SIM + EF_PATH_DF_GSM, @@ -1074,34 +1074,36 @@ let RIL = { * @return * true if the service is enabled, * false otherwise. */ isUSTServiceAvailable: function isUSTServiceAvailable(service) { service -= 1; let index = service / 8; let bitmask = 1 << (service % 8); - return this.UST && (index < this.UST.length) && (this.UST[index] & bitmask); + return this.iccInfo.ust && + (index < this.iccInfo.ust.length) && + (this.iccInfo.ust[index] & bitmask); }, /** * Read the UST from the ICC. */ getUST: function getUST() { function callback() { let length = Buf.readUint32(); // Each octet is encoded into two chars. let len = length / 2; - this.iccInfo.UST = GsmPDUHelper.readHexOctetArray(len); + this.iccInfo.ust = GsmPDUHelper.readHexOctetArray(len); Buf.readStringDelimiter(length); if (DEBUG) { let str = ""; - for (let i = 0; i < this.iccInfo.UST.length; i++) { - str += this.iccInfo.UST[i] + ", "; + for (let i = 0; i < this.iccInfo.ust.length; i++) { + str += this.iccInfo.ust[i] + ", "; } debug("UST: " + str); } } this.iccIO({ command: ICC_COMMAND_GET_RESPONSE, fileId: ICC_EF_UST, @@ -1177,34 +1179,34 @@ let RIL = { * Get ICC FDN. * * @paran requestId * Request id from RadioInterfaceLayer. */ getFDN: function getFDN(options) { function callback(options) { function add(contact) { - this.iccInfo.FDN.push(contact); + this.iccInfo.fdn.push(contact); }; function finish() { if (DEBUG) { - for (let i = 0; i < this.iccInfo.FDN.length; i++) { - debug("FDN[" + i + "] alphaId = " + this.iccInfo.FDN[i].alphaId + - " number = " + this.iccInfo.FDN[i].number); + for (let i = 0; i < this.iccInfo.fdn.length; i++) { + debug("FDN[" + i + "] alphaId = " + this.iccInfo.fdn[i].alphaId + + " number = " + this.iccInfo.fdn[i].number); } } this.sendDOMMessage({type: "icccontacts", contactType: "FDN", - contacts: this.iccInfo.FDN, + contacts: this.iccInfo.fdn, requestId: options.requestId}); }; this.parseDiallingNumber(options, add, finish); } - this.iccInfo.FDN = []; + this.iccInfo.fdn = []; this.iccIO({ command: ICC_COMMAND_GET_RESPONSE, fileId: ICC_EF_FDN, pathId: EF_PATH_MF_SIM + EF_PATH_DF_TELECOM, p1: 0, // For GET_RESPONSE, p1 = 0 p2: 0, // For GET_RESPONSE, p2 = 0 p3: GET_RESPONSE_EF_SIZE_BYTES, data: null, @@ -1222,34 +1224,34 @@ let RIL = { * @param fileId * EF id of the ADN. * @paran requestId * Request id from RadioInterfaceLayer. */ getADN: function getADN(options) { function callback(options) { function add(contact) { - this.iccInfo.ADN.push(contact); + this.iccInfo.adn.push(contact); }; function finish() { if (DEBUG) { - for (let i = 0; i < this.iccInfo.ADN.length; i++) { - debug("ADN[" + i + "] alphaId = " + this.iccInfo.ADN[i].alphaId + - " number = " + this.iccInfo.ADN[i].number); + for (let i = 0; i < this.iccInfo.adn.length; i++) { + debug("ADN[" + i + "] alphaId = " + this.iccInfo.adn[i].alphaId + + " number = " + this.iccInfo.adn[i].number); } } this.sendDOMMessage({type: "icccontacts", contactType: "ADN", - contacts: this.iccInfo.ADN, + contacts: this.iccInfo.adn, requestId: options.requestId}); }; this.parseDiallingNumber(options, add, finish); } - this.iccInfo.ADN = []; + this.iccInfo.adn = []; this.iccIO({ command: ICC_COMMAND_GET_RESPONSE, fileId: options.fileId, pathId: EF_PATH_MF_SIM + EF_PATH_DF_TELECOM, p1: 0, // For GET_RESPONSE, p1 = 0 p2: 0, // For GET_RESPONSE, p2 = 0 p3: GET_RESPONSE_EF_SIZE_BYTES, data: null, @@ -2001,23 +2003,25 @@ let RIL = { } } let cell = this.cellLocation; let cellChanged = false; // From TS 23.003, 0000 and 0xfffe are indicated that no valid LAI exists // in MS. So we still need to report the '0000' as well. - if (cell.lac !== state[1]) { - cell.lac = state[1]; + let lac = parseInt(state[1], 16); + if (cell.lac !== lac) { + cell.lac = lac; cellChanged = true; } - if (cell.cid !== state[2]) { - cell.cid = state[2]; + let cid = parseInt(state[2], 16); + if (cell.cid !== cid) { + cell.cid = cid; cellChanged = true; } if (cellChanged) { cell.type = "celllocationchanged"; this.sendDOMMessage(cell); } @@ -2698,17 +2702,17 @@ RIL[REQUEST_DIAL] = function REQUEST_DIA return; } }; RIL[REQUEST_GET_IMSI] = function REQUEST_GET_IMSI(length, options) { if (options.rilRequestError) { return; } - this.iccInfo.IMSI = Buf.readString(); + this.iccInfo.imsi = Buf.readString(); }; RIL[REQUEST_HANGUP] = function REQUEST_HANGUP(length, options) { if (options.rilRequestError) { return; } this.getCurrentCalls(); };