From 6c659fae80f710ecf3f50280da04029304ffa8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Wed, 31 Dec 2014 12:30:31 -0800 Subject: [PATCH] Backout bug 1098210 (2bd2fad9eac0) for suspicion of smoke test breakage. r=me --- dom/icc/Assertions.cpp | 12 ------------ dom/icc/Icc.cpp | 7 ++++--- dom/icc/Icc.h | 2 +- dom/icc/interfaces/nsIIccProvider.idl | 9 ++------- dom/system/gonk/RadioInterfaceLayer.js | 8 ++++---- dom/system/gonk/ril_consts.js | 5 ----- dom/webidl/MozIcc.webidl | 13 +++++-------- 7 files changed, 16 insertions(+), 40 deletions(-) diff --git a/dom/icc/Assertions.cpp b/dom/icc/Assertions.cpp index 03f7148d88b1..4d4c76cf34cd 100644 --- a/dom/icc/Assertions.cpp +++ b/dom/icc/Assertions.cpp @@ -94,18 +94,6 @@ 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 diff --git a/dom/icc/Icc.cpp b/dom/icc/Icc.cpp index 4199df4f4656..c693837ae970 100644 --- a/dom/icc/Icc.cpp +++ b/dom/icc/Icc.cpp @@ -384,7 +384,8 @@ Icc::UpdateContact(const JSContext* aCx, IccContactType aContactType, } already_AddRefed -Icc::MatchMvno(IccMvnoType aMvnoType, const nsAString& aMvnoData, +Icc::MatchMvno(const nsAString& aMvnoType, + const nsAString& aMvnoData, ErrorResult& aRv) { if (!mProvider) { @@ -394,8 +395,8 @@ Icc::MatchMvno(IccMvnoType aMvnoType, const nsAString& aMvnoData, nsRefPtr request; nsresult rv = mProvider->MatchMvno(mClientId, GetOwner(), - static_cast(aMvnoType), - aMvnoData, getter_AddRefs(request)); + aMvnoType, aMvnoData, + getter_AddRefs(request)); if (NS_FAILED(rv)) { aRv.Throw(rv); return nullptr; diff --git a/dom/icc/Icc.h b/dom/icc/Icc.h index cdc34ebe3975..4bf502480959 100644 --- a/dom/icc/Icc.h +++ b/dom/icc/Icc.h @@ -98,7 +98,7 @@ public: ErrorResult& aRv); already_AddRefed - MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData, + MatchMvno(const nsAString& aMvnoType, const nsAString& aMatchData, ErrorResult& aRv); IMPL_EVENT_HANDLER(iccinfochange) diff --git a/dom/icc/interfaces/nsIIccProvider.idl b/dom/icc/interfaces/nsIIccProvider.idl index 011d84be222a..7d7769129e0a 100644 --- a/dom/icc/interfaces/nsIIccProvider.idl +++ b/dom/icc/interfaces/nsIIccProvider.idl @@ -20,7 +20,7 @@ interface nsIIccListener : nsISupports /** * 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! @@ -85,11 +85,6 @@ interface nsIIccProvider : nsISupports 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 @@ -187,6 +182,6 @@ interface nsIIccProvider : nsISupports */ nsIDOMDOMRequest matchMvno(in unsigned long clientId, in nsIDOMWindow window, - in unsigned long mvnoType, + in DOMString mvnoType, in DOMString mvnoData); }; diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 246dfbcccaea..9dbf9746a31d 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -1993,20 +1993,20 @@ RadioInterface.prototype = { 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; @@ -2014,7 +2014,7 @@ RadioInterface.prototype = { } 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; diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 900c09dba804..56f2d5248ce4 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -2645,11 +2645,6 @@ 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; diff --git a/dom/webidl/MozIcc.webidl b/dom/webidl/MozIcc.webidl index 309b52249f19..f21ac6730b05 100644 --- a/dom/webidl/MozIcc.webidl +++ b/dom/webidl/MozIcc.webidl @@ -82,13 +82,6 @@ enum IccContactType "sdn" // Service Dialling Number. }; -enum IccMvnoType -{ - "imsi", - "spn", - "gid" -}; - dictionary IccUnlockCardLockOptions { required IccLockType lockType; @@ -322,13 +315,17 @@ interface MozIcc : EventTarget * * @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); };