Bug 835729 - Part 1: Fix updating operator's info. r=allstars.chh
authorEdgar Chen <echen@mozilla.com>
Tue, 29 Jan 2013 15:25:30 +0800
changeset 122226 785ce24738124c33b8d0c8708790087ae4a326ac
parent 122225 3fa2b18fae9c2f4e9575f1a14dc83f773fca4aff
child 122227 86c7d1b67175e819d74d411e2a181922735004f6
push id24327
push usergszorc@mozilla.com
push dateTue, 19 Feb 2013 05:22:32 +0000
treeherdermozilla-central@e8f8a3f6f1f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars.chh
bugs835729
milestone21.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
Bug 835729 - Part 1: Fix updating operator's info. r=allstars.chh
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -3070,42 +3070,43 @@ let RIL = {
 
     let [longName, shortName, networkTuple] = operatorData;
     let thisTuple = "" + this.operator.mcc + this.operator.mnc;
 
     if (this.operator.longName !== longName ||
         this.operator.shortName !== shortName ||
         thisTuple !== networkTuple) {
 
+      this.operator.mcc = 0;
+      this.operator.mnc = 0;
+
+      if (networkTuple) {
+        try {
+          this._processNetworkTuple(networkTuple, this.operator);
+        } catch (e) {
+          debug("Error processing operator tuple: " + e);
+        }
+      } else {
+        // According to ril.h, the operator fields will be NULL when the operator
+        // is not currently registered. We can avoid trying to parse the numeric
+        // tuple in that case.
+        if (DEBUG) {
+          debug("Operator is currently unregistered");
+        }
+      }
+
       let networkName = this.updateNetworkName();
       if (networkName) {
         this.operator.longName = networkName.fullName;
         this.operator.shortName = networkName.shortName;
       } else {
         this.operator.longName = longName;
         this.operator.shortName = shortName;
       }
 
-      this.operator.mcc = 0;
-      this.operator.mnc = 0;
-
-      // According to ril.h, the operator fields will be NULL when the operator
-      // is not currently registered. We can avoid trying to parse the numeric
-      // tuple in that case.
-      if (DEBUG && !longName) {
-        debug("Operator is currently unregistered");
-      }
-
-      if (networkTuple) {
-        try {
-          this._processNetworkTuple(networkTuple, this.operator);
-        } catch (e) {
-          debug("Error processing operator tuple: " + e);
-        }
-      }
       if (ICCUtilsHelper.updateDisplayCondition()) {
         ICCUtilsHelper.handleICCInfoChange();
       }
       this._sendNetworkInfoMessage(NETWORK_INFO_OPERATOR, this.operator);
     }
   },
 
   /**