Backed out changeset 5c6a41cf65df (bug 958773) for marionette-webapi test failures
authorEd Morley <emorley@mozilla.com>
Tue, 14 Jan 2014 09:36:43 +0000
changeset 163241 654854b387dd43d819a872ae20a4ebcdf63f690e
parent 163240 34dddf6f7ec1b05534483e8181a8e48278aa914b
child 163256 ea4b904216e677ea25c311ca9066640f44b2c8ab
child 163271 01fb70a7cdbfaef2bb139f9a9a7135ba93537246
child 163290 c491d6b2ee25d1f7d61e7beccde66b0e70f46914
push id25988
push useremorley@mozilla.com
push dateTue, 14 Jan 2014 09:37:21 +0000
treeherdermozilla-central@654854b387dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs958773
milestone29.0a1
backs out5c6a41cf65df8d97f0180df90c6628168a8955ec
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
Backed out changeset 5c6a41cf65df (bug 958773) for marionette-webapi test failures
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -689,37 +689,17 @@ CdmaIccInfo.prototype = {
 
 function RadioInterfaceLayer() {
   gMessageManager.init(this);
   gRadioEnabledController.init(this);
 
   let options = {
     debug: debugPref,
     cellBroadcastDisabled: false,
-    clirMode: RIL.CLIR_DEFAULT,
-    quirks: {
-      callstateExtraUint32:
-        libcutils.property_get("ro.moz.ril.callstate_extra_int", "false") === "true",
-      v5Legacy:
-        libcutils.property_get("ro.moz.ril.v5_legacy", "true") === "true",
-      requestUseDialEmergencyCall:
-        libcutils.property_get("ro.moz.ril.dial_emergency_call", "false") === "true",
-      simAppStateExtraFields:
-        libcutils.property_get("ro.moz.ril.simstate_extra_field", "false") === "true",
-      extraUint2ndCall:
-        libcutils.property_get("ro.moz.ril.extra_int_2nd_call", "false") == "true",
-      haveQueryIccLockRetryCount:
-        libcutils.property_get("ro.moz.ril.query_icc_count", "false") == "true",
-      sendStkProfileDownload:
-        libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true",
-      dataRegistrationOnDemand:
-        libcutils.property_get("ro.moz.ril.data_reg_on_demand", "false") == "true"
-    },
-    rilEmergencyNumbers: libcutils.property_get("ril.ecclist") ||
-                         libcutils.property_get("ro.ril.ecclist")
+    clirMode: RIL.CLIR_DEFAULT
   };
 
   try {
     options.cellBroadcastDisabled =
       Services.prefs.getBoolPref(kPrefCellBroadcastDisabled);
   } catch(e) {}
 
   try {
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -33,32 +33,31 @@
  *
  * Note: The code below is purposely lean on abstractions to be as lean in
  * terms of object allocations. As a result, it may look more like C than
  * JavaScript, and that's intended.
  */
 
 "use strict";
 
-importScripts("ril_consts.js");
+importScripts("ril_consts.js", "systemlibs.js");
 importScripts("resource://gre/modules/workers/require.js");
 
 // set to true in ril_consts.js to see debug messages
 let DEBUG = DEBUG_WORKER;
 let CLIENT_ID = -1;
 let GLOBAL = this;
 
 if (!this.debug) {
   // Debugging stub that goes nowhere.
   this.debug = function debug(message) {
     dump("RIL Worker[" + CLIENT_ID + "]: " + message + "\n");
   };
 }
 
-let RIL_EMERGENCY_NUMBERS;
 const DEFAULT_EMERGENCY_NUMBERS = ["112", "911"];
 
 // Timeout value for emergency callback mode.
 const EMERGENCY_CB_MODE_TIMEOUT_MS = 300000;  // 5 mins = 300000 ms.
 
 const ICC_MAX_LINEAR_FIXED_RECORDS = 0xfe;
 
 // MMI match groups
@@ -70,32 +69,33 @@ const MMI_MATCH_GROUP_SIB = 7;
 const MMI_MATCH_GROUP_SIC = 9;
 const MMI_MATCH_GROUP_PWD_CONFIRM = 11;
 const MMI_MATCH_GROUP_DIALING_NUMBER = 12;
 
 const MMI_MAX_LENGTH_SHORT_CODE = 2;
 
 const MMI_END_OF_USSD = "#";
 
-let RILQUIRKS_CALLSTATE_EXTRA_UINT32;
+let RILQUIRKS_CALLSTATE_EXTRA_UINT32 = libcutils.property_get("ro.moz.ril.callstate_extra_int", "false") === "true";
 // This may change at runtime since in RIL v6 and later, we get the version
 // number via the UNSOLICITED_RIL_CONNECTED parcel.
-let RILQUIRKS_V5_LEGACY;
-let RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL;
-let RILQUIRKS_SIM_APP_STATE_EXTRA_FIELDS;
+let RILQUIRKS_V5_LEGACY = libcutils.property_get("ro.moz.ril.v5_legacy", "true") === "true";
+let RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL = libcutils.property_get("ro.moz.ril.dial_emergency_call", "false") === "true";
+let RILQUIRKS_SIM_APP_STATE_EXTRA_FIELDS = libcutils.property_get("ro.moz.ril.simstate_extra_field", "false") === "true";
 // Needed for call-waiting on Peak device
-let RILQUIRKS_EXTRA_UINT32_2ND_CALL;
+let RILQUIRKS_EXTRA_UINT32_2ND_CALL = libcutils.property_get("ro.moz.ril.extra_int_2nd_call", "false") == "true";
 // On the emulator we support querying the number of lock retries
-let RILQUIRKS_HAVE_QUERY_ICC_LOCK_RETRY_COUNT;
+let RILQUIRKS_HAVE_QUERY_ICC_LOCK_RETRY_COUNT = libcutils.property_get("ro.moz.ril.query_icc_count", "false") == "true";
 
 // Ril quirk to Send STK Profile Download
-let RILQUIRKS_SEND_STK_PROFILE_DOWNLOAD;
+let RILQUIRKS_SEND_STK_PROFILE_DOWNLOAD = libcutils.property_get("ro.moz.ril.send_stk_profile_dl", "false") == "true";
 
 // Ril quirk to attach data registration on demand.
-let RILQUIRKS_DATA_REGISTRATION_ON_DEMAND;
+let RILQUIRKS_DATA_REGISTRATION_ON_DEMAND =
+  libcutils.property_get("ro.moz.ril.data_reg_on_demand", "false") == "true";
 
 // Marker object.
 let PENDING_NETWORK_TYPE = {};
 
 let Buf = {
   __proto__: (function(){
     return require("resource://gre/modules/workers/worker_buf.js").Buf;
   })(),
@@ -106,39 +106,39 @@ let Buf = {
   init: function() {
     this._init();
 
     // This gets incremented each time we send out a parcel.
     this.mToken = 1;
 
     // Maps tokens we send out with requests to the request type, so that
     // when we get a response parcel back, we know what request it was for.
-    this.mTokenRequestMap = new Map();
+    this.mTokenRequestMap = {};
   },
 
   /**
    * Process one parcel.
    */
   processParcel: function() {
     let response_type = this.readInt32();
 
     let request_type, options;
     if (response_type == RESPONSE_TYPE_SOLICITED) {
       let token = this.readInt32();
       let error = this.readInt32();
 
-      options = this.mTokenRequestMap.get(token);
+      options = this.mTokenRequestMap[token];
       if (!options) {
         if (DEBUG) {
           debug("Suspicious uninvited request found: " + token + ". Ignored!");
         }
         return;
       }
 
-      this.mTokenRequestMap.delete(token);
+      delete this.mTokenRequestMap[token];
       request_type = options.rilRequestType;
 
       options.rilRequestError = error;
       if (DEBUG) {
         debug("Solicited response for request type " + request_type +
               ", token " + token + ", error " + error);
       }
     } else if (response_type == RESPONSE_TYPE_UNSOLICITED) {
@@ -169,17 +169,17 @@ let Buf = {
     this.writeInt32(type);
     this.writeInt32(this.mToken);
 
     if (!options) {
       options = {};
     }
     options.rilRequestType = type;
     options.rilRequestError = null;
-    this.mTokenRequestMap.set(this.mToken, options);
+    this.mTokenRequestMap[this.mToken] = options;
     this.mToken++;
     return this.mToken;
   },
 
   simpleRequest: function(type, options) {
     this.newParcel(type, options);
     this.sendParcel();
   },
@@ -2907,18 +2907,22 @@ let RIL = {
 
   /**
    * Check a given number against the list of emergency numbers provided by the RIL.
    *
    * @param number
    *        The number to look up.
    */
    _isEmergencyNumber: function(number) {
-     // Check ril provided numbers first.
-     let numbers = RIL_EMERGENCY_NUMBERS;
+     // Check read-write ecclist property first.
+     let numbers = libcutils.property_get("ril.ecclist");
+     if (!numbers) {
+       // Then read-only ecclist property since others RIL only uses this.
+       numbers = libcutils.property_get("ro.ril.ecclist");
+     }
 
      if (numbers) {
        numbers = numbers.split(",");
      } else {
        // No ecclist system property, so use our own list.
        numbers = DEFAULT_EMERGENCY_NUMBERS;
      }
 
@@ -3576,18 +3580,21 @@ let RIL = {
 
         if (newCall.state == CALL_STATE_INCOMING) {
           newCall.isOutgoing = false;
         } else if (newCall.state == CALL_STATE_DIALING) {
           newCall.isOutgoing = true;
         }
 
         // Set flag for outgoing emergency call.
-        newCall.isEmergency = newCall.isOutgoing &&
-                              this._isEmergencyNumber(newCall.number);
+        if (newCall.isOutgoing && this._isEmergencyNumber(newCall.number)) {
+          newCall.isEmergency = true;
+        } else {
+          newCall.isEmergency = false;
+        }
 
         // Add to our map.
         if (newCall.isMpty) {
           conferenceChanged = true;
           newCall.isConference = true;
           this.currentConference.participants[newCall.callIndex] = newCall;
         } else {
           newCall.isConference = false;
@@ -4950,26 +4957,16 @@ let RIL = {
     }
   },
 
   setInitialOptions: function(options) {
     DEBUG = DEBUG_WORKER || options.debug;
     CLIENT_ID = options.clientId;
     this.cellBroadcastDisabled = options.cellBroadcastDisabled;
     this.clirMode = options.clirMode;
-    RIL_EMERGENCY_NUMBERS = options.rilEmergencyNumbers;
-    let quirks = options.quirks;
-    RILQUIRKS_CALLSTATE_EXTRA_UINT32 = quirks.callstateExtraUint32;
-    RILQUIRKS_V5_LEGACY = quirks.v5Legacy;
-    RILQUIRKS_REQUEST_USE_DIAL_EMERGENCY_CALL = quirks.requestUseDialEmergencyCall;
-    RILQUIRKS_SIM_APP_STATE_EXTRA_FIELDS = quirks.simAppStateExtraFields;
-    RILQUIRKS_EXTRA_UINT32_2ND_CALL = quirks.extraUint2ndCall;
-    RILQUIRKS_HAVE_QUERY_ICC_LOCK_RETRY_COUNT = quirks.haveQueryIccLockRetryCount;
-    RILQUIRKS_SEND_STK_PROFILE_DOWNLOAD = quirks.sendStkProfileDownload;
-    RILQUIRKS_DATA_REGISTRATION_ON_DEMAND = quirks.dataRegistrationOnDemand;
   }
 };
 
 RIL.initRILState();
 
 RIL[REQUEST_GET_SIM_STATUS] = function(length, options) {
   if (options.rilRequestError) {
     return;