Backout bug 1098210 (2bd2fad9eac0) for suspicion of smoke test breakage. r=me
authorFabrice Desré <fabrice@mozilla.com>
Wed, 31 Dec 2014 12:30:31 -0800
changeset 247592 74dc2a4ee7ef133746193ee603b55a1a85a7b23d
parent 247591 a1d05c74781d43c2d0371e89c75b94d6d68b5882
child 247593 0991331d99f4fb7cc3c84020fe458827d15f646f
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1098210
milestone37.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
Backout bug 1098210 (2bd2fad9eac0) for suspicion of smoke test breakage. r=me
dom/icc/Assertions.cpp
dom/icc/Icc.cpp
dom/icc/Icc.h
dom/icc/interfaces/nsIIccProvider.idl
dom/system/gonk/RadioInterfaceLayer.js
dom/system/gonk/ril_consts.js
dom/webidl/MozIcc.webidl
--- a/dom/icc/Assertions.cpp
+++ b/dom/icc/Assertions.cpp
@@ -89,25 +89,13 @@ ASSERT_ICC_LOCK_TYPE_EQUALITY(Fdn, CARD_
   ASSERT_EQUALITY(IccContactType, webidlState, xpidlState)
 
 ASSERT_ICC_CONTACT_TYPE_EQUALITY(Adn, CARD_CONTACT_TYPE_ADN);
 ASSERT_ICC_CONTACT_TYPE_EQUALITY(Fdn, CARD_CONTACT_TYPE_FDN);
 ASSERT_ICC_CONTACT_TYPE_EQUALITY(Sdn, CARD_CONTACT_TYPE_SDN);
 
 #undef ASSERT_ICC_CONTACT_TYPE_EQUALITY
 
-/**
- * Enum IccMvnoType
- */
-#define ASSERT_ICC_MVNO_TYPE_EQUALITY(webidlState, xpidlState) \
-  ASSERT_EQUALITY(IccMvnoType, webidlState, xpidlState)
-
-ASSERT_ICC_MVNO_TYPE_EQUALITY(Imsi, CARD_MVNO_TYPE_IMSI);
-ASSERT_ICC_MVNO_TYPE_EQUALITY(Spn, CARD_MVNO_TYPE_SPN);
-ASSERT_ICC_MVNO_TYPE_EQUALITY(Gid, CARD_MVNO_TYPE_GID);
-
-#undef ASSERT_ICC_MVNO_TYPE_EQUALITY
-
 #undef ASSERT_EQUALITY
 
 } // namespace icc
 } // namespace dom
 } // namespace mozilla
--- a/dom/icc/Icc.cpp
+++ b/dom/icc/Icc.cpp
@@ -379,28 +379,29 @@ Icc::UpdateContact(const JSContext* aCx,
     aRv.Throw(rv);
     return nullptr;
   }
 
   return request.forget().downcast<DOMRequest>();
 }
 
 already_AddRefed<DOMRequest>
-Icc::MatchMvno(IccMvnoType aMvnoType, const nsAString& aMvnoData,
+Icc::MatchMvno(const nsAString& aMvnoType,
+               const nsAString& aMvnoData,
                ErrorResult& aRv)
 {
   if (!mProvider) {
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   nsRefPtr<nsIDOMDOMRequest> request;
   nsresult rv = mProvider->MatchMvno(mClientId, GetOwner(),
-                                     static_cast<uint32_t>(aMvnoType),
-                                     aMvnoData, getter_AddRefs(request));
+                                     aMvnoType, aMvnoData,
+                                     getter_AddRefs(request));
   if (NS_FAILED(rv)) {
     aRv.Throw(rv);
     return nullptr;
   }
 
   return request.forget().downcast<DOMRequest>();
 }
 
--- a/dom/icc/Icc.h
+++ b/dom/icc/Icc.h
@@ -93,17 +93,17 @@ public:
   ReadContacts(IccContactType aContactType, ErrorResult& aRv);
 
   already_AddRefed<DOMRequest>
   UpdateContact(const JSContext* aCx, IccContactType aContactType,
                 JS::Handle<JS::Value> aContact, const nsAString& aPin2,
                 ErrorResult& aRv);
 
   already_AddRefed<DOMRequest>
-  MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData,
+  MatchMvno(const nsAString& aMvnoType, const nsAString& aMatchData,
             ErrorResult& aRv);
 
   IMPL_EVENT_HANDLER(iccinfochange)
   IMPL_EVENT_HANDLER(cardstatechange)
   IMPL_EVENT_HANDLER(stkcommand)
   IMPL_EVENT_HANDLER(stksessionend)
 
 private:
--- a/dom/icc/interfaces/nsIIccProvider.idl
+++ b/dom/icc/interfaces/nsIIccProvider.idl
@@ -15,17 +15,17 @@ interface nsIIccListener : nsISupports
   void notifyStkSessionEnd();
   void notifyCardStateChanged();
   void notifyIccInfoChanged();
 };
 
 /**
  * XPCOM component (in the content process) that provides the ICC information.
  */
-[scriptable, uuid(c3e3c1a9-6ac4-4916-a777-7d49ffd89c46)]
+[scriptable, uuid(937213c3-f64e-4f58-b4e0-3010f219d0c3)]
 interface nsIIccProvider : nsISupports
 {
   // MUST match enum IccCardState in MozIcc.webidl!
   const unsigned long CARD_STATE_UNKNOWN = 0;
   const unsigned long CARD_STATE_READY = 1;
   const unsigned long CARD_STATE_PIN_REQUIRED = 2;
   const unsigned long CARD_STATE_PUK_REQUIRED = 3;
   const unsigned long CARD_STATE_PERMANENT_BLOCKED = 4;
@@ -80,21 +80,16 @@ interface nsIIccProvider : nsISupports
   const unsigned long CARD_LOCK_TYPE_RSPCK_PUK = 19;
   const unsigned long CARD_LOCK_TYPE_FDN = 20;
 
   // MUST match with enum IccContactType in MozIcc.webidl
   const unsigned long CARD_CONTACT_TYPE_ADN = 0;
   const unsigned long CARD_CONTACT_TYPE_FDN = 1;
   const unsigned long CARD_CONTACT_TYPE_SDN = 2;
 
-  // MUST match with enum IccMvnoType in MozIcc.webidl
-  const unsigned long CARD_MVNO_TYPE_IMSI = 0;
-  const unsigned long CARD_MVNO_TYPE_SPN = 1;
-  const unsigned long CARD_MVNO_TYPE_GID = 2;
-
   /**
    * Called when a content process registers receiving unsolicited messages from
    * RadioInterfaceLayer in the chrome process. Only a content process that has
    * the 'mobileconnection' permission is allowed to register.
    */
   void registerIccMsg(in unsigned long clientId, in nsIIccListener listener);
   void unregisterIccMsg(in unsigned long clientId, in nsIIccListener listener);
 
@@ -182,11 +177,11 @@ interface nsIIccProvider : nsISupports
                                    in nsIDOMWindow window,
                                    in long channel);
 
   /**
    * Helpers
    */
   nsIDOMDOMRequest matchMvno(in unsigned long clientId,
                              in nsIDOMWindow window,
-                             in unsigned long mvnoType,
+                             in DOMString mvnoType,
                              in DOMString mvnoData);
 };
--- a/dom/system/gonk/RadioInterfaceLayer.js
+++ b/dom/system/gonk/RadioInterfaceLayer.js
@@ -1988,38 +1988,38 @@ RadioInterface.prototype = {
       }
     }
     return true;
   },
 
   matchMvno: function(target, message) {
     if (DEBUG) this.debug("matchMvno: " + JSON.stringify(message));
 
-    if (!message || !message.mvnoData) {
+    if (!message || !message.mvnoType || !message.mvnoData) {
       message.errorMsg = RIL.GECKO_ERROR_INVALID_PARAMETER;
     }
 
     if (!message.errorMsg) {
       switch (message.mvnoType) {
-        case RIL.GECKO_CARDMVNO_TYPE_IMSI:
+        case "imsi":
           if (!this.rilContext.imsi) {
             message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
             break;
           }
           message.result = this.isImsiMatches(message.mvnoData);
           break;
-        case RIL.GECKO_CARDMVNO_TYPE_SPN:
+        case "spn":
           let spn = this.rilContext.iccInfo && this.rilContext.iccInfo.spn;
           if (!spn) {
             message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
             break;
           }
           message.result = spn == message.mvnoData;
           break;
-        case RIL.GECKO_CARDMVNO_TYPE_GID:
+        case "gid":
           this.workerMessenger.send("getGID1", null, (function(response) {
             let gid = response.gid1;
             let mvnoDataLength = message.mvnoData.length;
 
             if (!gid) {
               message.errorMsg = RIL.GECKO_ERROR_GENERIC_FAILURE;
             } else if (mvnoDataLength > gid.length) {
               message.result = false;
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -2640,21 +2640,16 @@ GECKO_CARDLOCK_TO_SEL_CODE[GECKO_CARDLOC
 GECKO_CARDLOCK_TO_SEL_CODE[GECKO_CARDLOCK_CCK] = ICC_SEL_CODE_PH_CORP_PIN;
 GECKO_CARDLOCK_TO_SEL_CODE[GECKO_CARDLOCK_SPCK] = ICC_SEL_CODE_PH_SP_PIN;
 
 // See nsIIccProvider::CARD_CONTACT_TYPE_*
 this.GECKO_CARDCONTACT_TYPE_ADN = 0;
 this.GECKO_CARDCONTACT_TYPE_FDN = 1;
 this.GECKO_CARDCONTACT_TYPE_SDN = 2;
 
-// See nsIIccProvider::CARD_MVNO_TYPE_*
-this.GECKO_CARDMVNO_TYPE_IMSI = 0;
-this.GECKO_CARDMVNO_TYPE_SPN = 1;
-this.GECKO_CARDMVNO_TYPE_GID = 2;
-
 // See ril.h RIL_PersoSubstate
 this.PERSONSUBSTATE = {};
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_UNKNOWN] = GECKO_CARDSTATE_UNKNOWN;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_IN_PROGRESS] = GECKO_CARDSTATE_PERSONALIZATION_IN_PROGRESS;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_READY] = GECKO_CARDSTATE_PERSONALIZATION_READY;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK] = GECKO_CARDSTATE_NETWORK_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET] = GECKO_CARDSTATE_NETWORK_SUBSET_LOCKED;
 PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_CORPORATE] = GECKO_CARDSTATE_CORPORATE_LOCKED;
--- a/dom/webidl/MozIcc.webidl
+++ b/dom/webidl/MozIcc.webidl
@@ -77,23 +77,16 @@ enum IccLockType
 
 enum IccContactType
 {
   "adn", // Abbreviated Dialling Number.
   "fdn", // Fixed Dialling Number.
   "sdn"  // Service Dialling Number.
 };
 
-enum IccMvnoType
-{
-  "imsi",
-  "spn",
-  "gid"
-};
-
 dictionary IccUnlockCardLockOptions
 {
   required IccLockType lockType;
 
   DOMString? pin = null; // Necessary for lock types: "pin", "pin2", "nck",
                          // "nck1", "nck2", "hnck", "cck", "spck", "rcck",
                          // "rspck".
 
@@ -317,18 +310,22 @@ interface MozIcc : EventTarget
   // Integrated Circuit Card Helpers.
 
   /**
    * Verify whether the passed data (matchData) matches with some ICC's field
    * according to the mvno type (mvnoType).
    *
    * @param mvnoType
    *        Mvno type to use to compare the match data.
+   *        Currently, we only support 'imsi'.
    * @param matchData
    *        Data to be compared with ICC's field.
    *
    * @return a DOMRequest.
    *         The request's result will be a boolean indicating the matching
    *         result.
+   *
+   * TODO: change param mvnoType to WebIDL enum after Bug 864489 -
+   *       B2G RIL: use ipdl as IPC in MozIccManager
    */
   [Throws]
-  DOMRequest matchMvno(IccMvnoType mvnoType, DOMString matchData);
+  DOMRequest matchMvno(DOMString mvnoType, DOMString matchData);
 };