Bug 819790 - Fix reading SPDI fail. r=vicamo
authorAlexandre Lissy <alexandre.lissy@etu.univ-tours.fr>
Thu, 13 Dec 2012 16:42:23 +0800
changeset 116036 d72d915e308b65b4cf4a726d3aee0cc74f651f84
parent 116035 d9e54b62a5f54cc36c6478dd5f152c484a32d348
child 116037 d78361a315b31b2251d668448c6797d929a6acf8
push id24034
push useremorley@mozilla.com
push dateFri, 14 Dec 2012 15:28:57 +0000
treeherdermozilla-central@50d8f411d305 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvicamo
bugs819790
milestone20.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 819790 - Fix reading SPDI fail. r=vicamo
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -1515,17 +1515,17 @@ let RIL = {
    *
    * See ETSI TS 100.977 section 10.3.4 EF_PLMNsel
    */
   getPLMNSelector: function getPLMNSelector() {
     function callback() {
       if (DEBUG) debug("PLMN Selector: Process PLMN Selector");
 
       let length = Buf.readUint32();
-      this.iccInfoPrivate.PLMN = this.readPLMNEntries(length/6);
+      this.iccInfoPrivate.PLMN = this.readPLMNEntries(length/3);
       Buf.readStringDelimiter(length);
 
       if (DEBUG) debug("PLMN Selector: " + JSON.stringify(this.iccInfoPrivate.PLMN));
 
       if (this.updateDisplayCondition()) {
         this._handleICCInfoChange();
       }
     }
@@ -1565,17 +1565,17 @@ let RIL = {
         tlvLen = GsmPDUHelper.readHexOctet();
         readLen += 2; // For tag and length.
         switch (tlvTag) {
         case SPDI_TAG_SPDI:
           // The value part itself is a TLV.
           continue;
         case SPDI_TAG_PLMN_LIST:
           // This PLMN list is what we want.
-          this.iccInfoPrivate.SPDI = readPLMNEntries(tlvLen/6);
+          this.iccInfoPrivate.SPDI = this.readPLMNEntries(tlvLen/3);
           readLen += tlvLen;
           endLoop = true;
           break;
         default:
           // We don't care about its content if its tag is not SPDI nor
           // PLMN_LIST.
           GsmPDUHelper.readHexOctetArray(tlvLen);
           readLen += tlvLen;
@@ -2312,17 +2312,17 @@ let RIL = {
                     GsmPDUHelper.readHexOctet(),
                     GsmPDUHelper.readHexOctet()];
         if (DEBUG) debug("readPLMNEntries: Reading PLMN entry: [" + index +
                          "]: '" + plmn + "'");
         if (plmn[0] != 0xFF &&
             plmn[1] != 0xFF &&
             plmn[2] != 0xFF) {
           let semiOctets = [];
-          for (let i = 0; i < plmn.length; i++) {
+          for (let idx = 0; idx < plmn.length; idx++) {
             semiOctets.push((plmn[idx] & 0xF0) >> 4);
             semiOctets.push(plmn[idx] & 0x0F);
           }
 
           // According to TS 24.301, 9.9.3.12, the semi octets is arranged
           // in format:
           // Byte 1: MCC[2] | MCC[1]
           // Byte 2: MNC[3] | MCC[3]