Bug 978027 - Part 3: Get icc app index only when the _isCdma flag is ready to use. r=allstars.chh, a=1.4+
☠☠ backed out by ff6d4fb1ee34 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Mon, 07 Apr 2014 16:57:45 +0800
changeset 192879 c2f4decd1d2f8572c818c2350fe0044c6c31c930
parent 192878 a8bdec0445f175cbf9bf2f7ee4c0f43868f54160
child 192880 24e3dcfeccf485d62f11f26dd81b09a2aff063e0
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars, 1
bugs978027
milestone30.0a2
Bug 978027 - Part 3: Get icc app index only when the _isCdma flag is ready to use. r=allstars.chh, a=1.4+
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -3146,16 +3146,24 @@ RilObject.prototype = {
   reportStkServiceIsRunning: function() {
     this.context.Buf.simpleRequest(REQUEST_REPORT_STK_SERVICE_IS_RUNNING);
   },
 
   /**
    * Process ICC status.
    */
   _processICCStatus: function(iccStatus) {
+    // If |_waitingRadioTech| is true, we should not get app information because
+    // the |_isCdma| flag is not ready yet. Otherwise we may use wrong index to
+    // get app information, especially for the case that icc card has both cdma
+    // and gsm subscription.
+    if (this._waitingRadioTech) {
+      return;
+    }
+
     this.iccStatus = iccStatus;
     let newCardState;
     let index = this._isCdma ? iccStatus.cdmaSubscriptionAppIndex :
                                iccStatus.gsmUmtsSubscriptionAppIndex;
     let app = iccStatus.apps[index];
 
     // When |iccStatus.cardState| is not CARD_STATE_PRESENT or have incorrect
     // app information, we can not get iccId. So treat ICC as undetected.
@@ -4240,17 +4248,17 @@ RilObject.prototype = {
       this._isCdma = isCdma;
       this._waitingRadioTech = false;
       if (this._isCdma) {
         this.getDeviceIdentity();
       } else {
         this.getIMEI();
         this.getIMEISV();
       }
-       this.getICCStatus();
+      this.getICCStatus();
     }
   },
 
   /**
    * Helper for returning the TOA for the given dial string.
    */
   _toaFromString: function(number) {
     let toa = TOA_UNKNOWN;