Backout bug 1098210 (2bd2fad9eac0) for suspicion of smoke test breakage. r=me

This commit is contained in:
Fabrice Desré 2014-12-31 12:30:31 -08:00
parent c55dea84bd
commit 6c659fae80
7 changed files with 16 additions and 40 deletions

View File

@ -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

View File

@ -384,7 +384,8 @@ Icc::UpdateContact(const JSContext* aCx, IccContactType aContactType,
}
already_AddRefed<DOMRequest>
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<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;

View File

@ -98,7 +98,7 @@ public:
ErrorResult& aRv);
already_AddRefed<DOMRequest>
MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData,
MatchMvno(const nsAString& aMvnoType, const nsAString& aMatchData,
ErrorResult& aRv);
IMPL_EVENT_HANDLER(iccinfochange)

View File

@ -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);
};

View File

@ -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;

View File

@ -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;

View File

@ -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);
};