Bug 833215 - Part 1: rename getFoo to readFoo in ICCRecordHelper. r=vicamo
authorYoshi Huang <allstars.chh@mozilla.com>
Wed, 10 Apr 2013 15:32:17 +0800
changeset 130774 e9a1c44d1ca9639dda826708eeeaaa2451a7f91a
parent 130773 fe184c67d86989478d53f9dc3a263a1eeb7e7afd
child 130775 4bb7ccc2d7435bedbb59d73b49cc8bc15c6298b9
push idunknown
push userunknown
push dateunknown
reviewersvicamo
bugs833215
milestone23.0a1
Bug 833215 - Part 1: rename getFoo to readFoo in ICCRecordHelper. r=vicamo
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -2936,17 +2936,17 @@ let RIL = {
 
     // This was moved down from CARD_APPSTATE_READY
     this.requestNetworkInfo();
     this.getSignalStrength();
     if (newCardState == GECKO_CARDSTATE_READY) {
       // For type SIM, we need to check EF_phase first.
       // Other types of ICC we can send Terminal_Profile immediately.
       if (this.appType == CARD_APPTYPE_SIM) {
-        ICCRecordHelper.getICCPhase();
+        ICCRecordHelper.readICCPhase();
         ICCRecordHelper.fetchICCRecords();
       } else if (this.appType == CARD_APPTYPE_USIM) {
         this.sendStkTerminalProfile(STK_SUPPORTED_TERMINAL_PROFILE);
         ICCRecordHelper.fetchICCRecords();
       } else if (this.appType == CARD_APPTYPE_RUIM) {
         this.sendStkTerminalProfile(STK_SUPPORTED_TERMINAL_PROFILE);
         RuimRecordHelper.fetchRuimRecords();
       }
@@ -10026,29 +10026,29 @@ ICCIOHelper[ICC_COMMAND_UPDATE_RECORD] =
 /**
  * Helper for ICC records.
  */
 let ICCRecordHelper = {
   /**
    * Fetch ICC records.
    */
   fetchICCRecords: function fetchICCRecords() {
-    this.getICCID();
+    this.readICCID();
     RIL.getIMSI();
-    this.getMSISDN();
-    this.getAD();
-    this.getSST();
-    this.getMBDN();
-  },
-
-  /**
-   * Get EF_phase.
+    this.readMSISDN();
+    this.readAD();
+    this.readSST();
+    this.readMBDN();
+  },
+
+  /**
+   * Read EF_phase.
    * This EF is only available in SIM.
    */
-  getICCPhase: function getICCPhase() {
+  readICCPhase: function readICCPhase() {
     function callback() {
       let length = Buf.readUint32();
 
       let phase = GsmPDUHelper.readHexOctet();
       // If EF_phase is coded '03' or greater, an ME supporting STK shall
       // perform the PROFILE DOWNLOAD procedure.
       if (phase >= ICC_PHASE_2_PROFILE_DOWNLOAD_REQUIRED) {
         RIL.sendStkTerminalProfile(STK_SUPPORTED_TERMINAL_PROFILE);
@@ -10059,17 +10059,17 @@ let ICCRecordHelper = {
 
     ICCIOHelper.loadTransparentEF({fileId: ICC_EF_PHASE,
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read the ICCID.
    */
-  getICCID: function getICCID() {
+  readICCID: function readICCID() {
     function callback() {
       let length = Buf.readUint32();
       RIL.iccInfo.iccid = GsmPDUHelper.readSwappedNibbleBcdString(length / 2);
       Buf.readStringDelimiter(length);
 
       if (DEBUG) debug("ICCID: " + RIL.iccInfo.iccid);
       if (RIL.iccInfo.iccid) {
         ICCUtilsHelper.handleICCInfoChange();
@@ -10078,17 +10078,17 @@ let ICCRecordHelper = {
 
     ICCIOHelper.loadTransparentEF({fileId: ICC_EF_ICCID,
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read the MSISDN from the ICC.
    */
-  getMSISDN: function getMSISDN() {
+  readMSISDN: function readMSISDN() {
     function callback(options) {
       let contact = GsmPDUHelper.readAlphaIdDiallingNumber(options.recordSize);
       if (!contact || RIL.iccInfo.msisdn === contact.number) {
         return;
       }
       RIL.iccInfo.msisdn = contact.number;
       if (DEBUG) debug("MSISDN: " + RIL.iccInfo.msisdn);
       ICCUtilsHelper.handleICCInfoChange();
@@ -10096,17 +10096,17 @@ let ICCRecordHelper = {
 
     ICCIOHelper.loadLinearFixedEF({fileId: ICC_EF_MSISDN,
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read the AD (Administrative Data) from the ICC.
    */
-  getAD: function getAD() {
+  readAD: function readAD() {
     function callback() {
       let length = Buf.readUint32();
       // Each octet is encoded into two chars.
       let len = length / 2;
       let ad = GsmPDUHelper.readHexOctetArray(len);
       Buf.readStringDelimiter(length);
 
       if (DEBUG) {
@@ -10130,17 +10130,17 @@ let ICCRecordHelper = {
 
     ICCIOHelper.loadTransparentEF({fileId: ICC_EF_AD,
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read the SPN (Service Provider Name) from the ICC.
    */
-  getSPN: function getSPN() {
+  readSPN: function readSPN() {
     function callback() {
       let length = Buf.readUint32();
       // Each octet is encoded into two chars.
       // Minus 1 because the first octet is used to store display condition.
       let len = (length / 2) - 1;
       let spnDisplayCondition = GsmPDUHelper.readHexOctet();
       let spn = GsmPDUHelper.readAlphaIdentifier(len);
       Buf.readStringDelimiter(length);
@@ -10161,17 +10161,17 @@ let ICCRecordHelper = {
 
     ICCIOHelper.loadTransparentEF({fileId: ICC_EF_SPN,
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read the (U)SIM Service Table from the ICC.
    */
-  getSST: function getSST() {
+  readSST: function readSST() {
     function callback() {
       let length = Buf.readUint32();
       // Each octet is encoded into two chars.
       let len = length / 2;
       let sst = GsmPDUHelper.readHexOctetArray(len);
       Buf.readStringDelimiter(length);
       RIL.iccInfoPrivate.sst = sst;
       if (DEBUG) {
@@ -10180,49 +10180,49 @@ let ICCRecordHelper = {
           str += sst[i] + ", ";
         }
         debug("SST: " + str);
       }
 
       // Fetch SPN and PLMN list, if some of them are available.
       if (ICCUtilsHelper.isICCServiceAvailable("SPN")) {
         if (DEBUG) debug("SPN: SPN is available");
-        this.getSPN();
+        this.readSPN();
       } else {
         if (DEBUG) debug("SPN: SPN service is not available");
       }
 
       if (ICCUtilsHelper.isICCServiceAvailable("SPDI")) {
         if (DEBUG) debug("SPDI: SPDI available.");
-        this.getSPDI();
+        this.readSPDI();
       } else {
         if (DEBUG) debug("SPDI: SPDI service is not available");
       }
 
       if (ICCUtilsHelper.isICCServiceAvailable("PNN")) {
         if (DEBUG) debug("PNN: PNN is available");
         this.readPNN();
       } else {
         if (DEBUG) debug("PNN: PNN is not available");
       }
 
       if (ICCUtilsHelper.isICCServiceAvailable("OPL")) {
         if (DEBUG) debug("OPL: OPL is available");
-        this.getOPL();
+        this.readOPL();
       } else {
         if (DEBUG) debug("OPL: OPL is not available");
       }
 
       if (ICCUtilsHelper.isICCServiceAvailable("CBMI")) {
-        this.getCBMI();
+        this.readCBMI();
       } else {
         RIL.cellBroadcastConfigs.CBMI = null;
       }
       if (ICCUtilsHelper.isICCServiceAvailable("CBMIR")) {
-        this.getCBMIR();
+        this.readCBMIR();
       } else {
         RIL.cellBroadcastConfigs.CBMIR = null;
       }
       RIL._mergeAllCellBroadcastConfigs();
     }
 
     // ICC_EF_UST has the same value with ICC_EF_SST.
     ICCIOHelper.loadTransparentEF({fileId: ICC_EF_SST,
@@ -10297,21 +10297,21 @@ let ICCRecordHelper = {
                                      recordNumber: contact.recordId,
                                      dataWriter: dataWriter.bind(this),
                                      pin2: pin2,
                                      callback: callback.bind(this),
                                      onerror: onerror});
   },
 
   /**
-   * Get ICC MBDN. (Mailbox Dialling Number)
+   * Read ICC MBDN. (Mailbox Dialling Number)
    *
    * @see TS 131.102, clause 4.2.60
    */
-  getMBDN: function getMBDN() {
+  readMBDN: function readMBDN() {
     function callback(options) {
       let contact = GsmPDUHelper.readAlphaIdDiallingNumber(options.recordSize);
       if (!contact || RIL.iccInfo.mbdn === contact.number){
         return;
       }
       RIL.iccInfo.mbdn = contact.number;
       if (DEBUG) {
         debug("MBDN, alphaId="+contact.alphaId+" number="+contact.number);
@@ -10533,17 +10533,17 @@ let ICCRecordHelper = {
                                    onerror: onerror});
   },
 
   /**
    * Read the PLMNsel (Public Land Mobile Network) from the ICC.
    *
    * See ETSI TS 100.977 section 10.3.4 EF_PLMNsel
    */
-  getPLMNSelector: function getPLMNSelector() {
+  readPLMNSelector: function readPLMNSelector() {
     function callback() {
       if (DEBUG) debug("PLMN Selector: Process PLMN Selector");
 
       let length = Buf.readUint32();
       RIL.iccInfoPrivate.PLMN = this.readPLMNEntries(length/3);
       Buf.readStringDelimiter(length);
 
       if (DEBUG) debug("PLMN Selector: " + JSON.stringify(RIL.iccInfoPrivate.PLMN));
@@ -10559,17 +10559,17 @@ let ICCRecordHelper = {
   },
 
   /**
    * Read the SPDI (Service Provider Display Information) from the ICC.
    *
    * See TS 131.102 section 4.2.66 for USIM and TS 51.011 section 10.3.50
    * for SIM.
    */
-  getSPDI: function getSPDI() {
+  readSPDI: function readSPDI() {
     function callback() {
       let length = Buf.readUint32();
       let readLen = 0;
       let endLoop = false;
       RIL.iccInfoPrivate.SPDI = null;
       while ((readLen < length / 2) && !endLoop) {
         let tlvTag = GsmPDUHelper.readHexOctet();
         let tlvLen = GsmPDUHelper.readHexOctet();
@@ -10607,17 +10607,17 @@ let ICCRecordHelper = {
                                    callback: callback.bind(this)});
   },
 
   /**
    * Read EFcbmi (Cell Broadcast Message Identifier selection)
    *
    * @see 3GPP TS 31.102 v110.02.0 section 4.2.14 EFcbmi
    */
-  getCBMI: function getCBMI() {
+  readCBMI: function readCBMI() {
     function callback() {
       let strLength = Buf.readUint32();
 
       // Each Message Identifier takes two octets and each octet is encoded
       // into two chars.
       let numIds = strLength / 4, list = null;
       if (numIds) {
         list = [];
@@ -10650,17 +10650,17 @@ let ICCRecordHelper = {
                                    onerror: onerror.bind(this)});
   },
 
   /**
    * Read EFcbmir (Cell Broadcast Message Identifier Range selection)
    *
    * @see 3GPP TS 31.102 v110.02.0 section 4.2.22 EFcbmir
    */
-  getCBMIR: function getCBMIR() {
+  readCBMIR: function readCBMIR() {
     function callback() {
       let strLength = Buf.readUint32();
 
       // Each Message Identifier range takes four octets and each octet is
       // encoded into two chars.
       let numIds = strLength / 8, list = null;
       if (numIds) {
         list = [];
@@ -10698,17 +10698,17 @@ let ICCRecordHelper = {
   },
 
   /**
    * Read OPL (Operator PLMN List) from USIM.
    *
    * See 3GPP TS 31.102 Sec. 4.2.59 for USIM
    *     3GPP TS 51.011 Sec. 10.3.42 for SIM.
    */
-  getOPL: function getOPL() {
+  readOPL: function readOPL() {
     let opl = [];
     function callback(options) {
       let len = Buf.readUint32();
       // The first 7 bytes are LAI (for UMTS) and the format of LAI is defined
       // in 3GPP TS 23.003, Sec 4.1
       //    +-------------+---------+
       //    | Octet 1 - 3 | MCC/MNC |
       //    +-------------+---------+
@@ -11683,17 +11683,17 @@ let ICCContactHelper = {
   updatePhonebookSet: function updatePhonebookSet(pbr, contact, onsuccess, onerror) {
     // TODO: Bug 859659, update EF_Email and EF_ANR.
     ICCRecordHelper.updateADNLike(pbr.adn.fileId, contact, null, onsuccess, onerror);
   }
 };
 
 let RuimRecordHelper = {
   fetchRuimRecords: function fetchRuimRecords() {
-    ICCRecordHelper.getICCID();
+    ICCRecordHelper.readICCID();
     RIL.getIMSI();
     this.readCST();
     this.readCDMAHome();
   },
 
   /**
    * Read CDMAHOME for CSIM.
    * See 3GPP2 C.S0023 Sec. 3.4.8.