Bug 1033142 - Part 1: read EF_GID1 from (u)sim card. r=hsinyi
authorJessica Jong <jjong@mozilla.com>
Fri, 18 Jul 2014 11:41:35 +0800
changeset 215568 417695c8bf7e817d266cbc1b53b14667303fc261
parent 215565 eec86327612e03a1cb18fc105909b11cd1071f18
child 215569 6b72a8cb2e98e46b35838bbf29010016ac3dbced
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs1033142
milestone33.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 1033142 - Part 1: read EF_GID1 from (u)sim card. r=hsinyi
dom/system/gonk/ril_consts.js
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -497,16 +497,17 @@ this.ICC_EF_ICCID  = 0x2fe2;
 this.ICC_EF_IMG    = 0x4f20;
 this.ICC_EF_PBR    = 0x4f30;
 this.ICC_EF_PLMNsel = 0x6f30; // PLMN for SIM
 this.ICC_EF_SST    = 0x6f38;
 this.ICC_EF_UST    = 0x6f38; // For USIM
 this.ICC_EF_ADN    = 0x6f3a;
 this.ICC_EF_FDN    = 0x6f3b;
 this.ICC_EF_SMS    = 0x6f3c;
+this.ICC_EF_GID1   = 0x6f3e;
 this.ICC_EF_MSISDN = 0x6f40;
 this.ICC_EF_CBMI   = 0x6f45;
 this.ICC_EF_SPN    = 0x6f46;
 this.ICC_EF_CBMID  = 0x6f48;
 this.ICC_EF_SDN    = 0x6f49;
 this.ICC_EF_EXT1   = 0x6f4a;
 this.ICC_EF_EXT2   = 0x6f4b;
 this.ICC_EF_EXT3   = 0x6f4c;
@@ -1227,16 +1228,17 @@ this.STK_SUPPORTED_TERMINAL_PROFILE = [
  */
 this.GECKO_ICC_SERVICES = {
   sim: {
     ADN: 2,
     FDN: 3,
     PLMNSEL: 7,
     MSISDN: 9,
     CBMI: 14,
+    GID1: 15,
     SPN: 17,
     SDN: 18,
     DATA_DOWNLOAD_SMS_CB: 25,
     DATA_DOWNLOAD_SMS_PP: 26,
     CBMIR: 30,
     BDN: 31,
     PNN: 51,
     OPL: 52,
@@ -1245,16 +1247,17 @@ this.GECKO_ICC_SERVICES = {
     SPDI: 56
   },
   usim: {
     FDN: 2,
     SDN: 4,
     BDN: 6,
     CBMI: 15,
     CBMIR: 16,
+    GID1: 17,
     SPN: 19,
     MSISDN: 21,
     DATA_DOWNLOAD_SMS_PP: 28,
     DATA_DOWNLOAD_SMS_CB: 29,
     PNN: 45,
     OPL: 46,
     MDN: 47,
     MWIS: 48,
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -11857,16 +11857,17 @@ ICCFileHelperObject.prototype = {
       case ICC_EF_SPDI:
       case ICC_EF_SST:
       case ICC_EF_PHASE:
       case ICC_EF_CBMI:
       case ICC_EF_CBMID:
       case ICC_EF_CBMIR:
       case ICC_EF_OPL:
       case ICC_EF_PNN:
+      case ICC_EF_GID1:
         return EF_PATH_MF_SIM + EF_PATH_DF_GSM;
       default:
         return null;
     }
   },
 
   /**
    * This function handles EFs for USIM.
@@ -11882,16 +11883,17 @@ ICCFileHelperObject.prototype = {
       case ICC_EF_SPN:
       case ICC_EF_SPDI:
       case ICC_EF_CBMI:
       case ICC_EF_CBMID:
       case ICC_EF_CBMIR:
       case ICC_EF_OPL:
       case ICC_EF_PNN:
       case ICC_EF_SMS:
+      case ICC_EF_GID1:
         return EF_PATH_MF_SIM + EF_PATH_ADF_USIM;
       default:
         // The file ids in USIM phone book entries are decided by the
         // card manufacturer. So if we don't match any of the cases
         // above and if its a USIM return the phone book path.
         return EF_PATH_MF_SIM + EF_PATH_DF_TELECOM + EF_PATH_DF_PHONEBOOK;
     }
   },
@@ -13026,16 +13028,23 @@ SimRecordHelperObject.prototype = {
 
       if (ICCUtilsHelper.isICCServiceAvailable("OPL")) {
         if (DEBUG) this.context.debug("OPL: OPL is available");
         this.readOPL();
       } else {
         if (DEBUG) this.context.debug("OPL: OPL is not available");
       }
 
+      if (ICCUtilsHelper.isICCServiceAvailable("GID1")) {
+        if (DEBUG) this.context.debug("GID1: GID1 is available");
+        this.readGID1();
+      } else {
+        if (DEBUG) this.context.debug("GID1: GID1 is not available");
+      }
+
       if (ICCUtilsHelper.isICCServiceAvailable("CBMI")) {
         this.readCBMI();
       } else {
         RIL.cellBroadcastConfigs.CBMI = null;
       }
       if (ICCUtilsHelper.isICCServiceAvailable("DATA_DOWNLOAD_SMS_CB")) {
         this.readCBMID();
       } else {
@@ -13617,16 +13626,33 @@ SimRecordHelperObject.prototype = {
 
     this.context.ICCIOHelper.loadLinearFixedEF({
       fileId: ICC_EF_SMS,
       recordNumber: recordNumber,
       callback: callback.bind(this),
       onerror: onerror
     });
   },
+
+  readGID1: function() {
+    function callback() {
+      let Buf = this.context.Buf;
+      let RIL = this.context.RIL;
+
+      RIL.iccInfoPrivate.gid1 = Buf.readString();
+      if (DEBUG) {
+        this.context.debug("GID1: " + RIL.iccInfoPrivate.gid1);
+      }
+    }
+
+    this.context.ICCIOHelper.loadTransparentEF({
+      fileId: ICC_EF_GID1,
+      callback: callback.bind(this)
+    });
+  },
 };
 
 function RuimRecordHelperObject(aContext) {
   this.context = aContext;
 }
 RuimRecordHelperObject.prototype = {
   context: null,