diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 401c4e7bec86..c0c9680b9e06 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -2350,6 +2350,18 @@ this.GECKO_CARDSTATE_SERVICE_PROVIDER_PUK_REQUIRED = "serviceProviderPukRequired this.GECKO_CARDSTATE_SIM_PUK_REQUIRED = "simPersonalizationPukRequired"; this.GECKO_CARDSTATE_READY = "ready"; +this.GECKO_CARDLOCK_PIN = "pin"; +this.GECKO_CARDLOCK_PIN2 = "pin2"; +this.GECKO_CARDLOCK_PUK = "puk"; +this.GECKO_CARDLOCK_PUK2 = "puk2"; +this.GECKO_CARDLOCK_FDN = "fdn"; +this.GECKO_CARDLOCK_NCK = "nck"; +this.GECKO_CARDLOCK_CCK = "cck"; +this.GECKO_CARDLOCK_SPCK = "spck"; +this.GECKO_CARDLOCK_NCK_PUK = "nckPuk"; +this.GECKO_CARDLOCK_CCK_PUK = "cckPuk"; +this.GECKO_CARDLOCK_SPCK_PUK = "spckPuk"; + // See ril.h RIL_PersoSubstate this.PERSONSUBSTATE = {}; PERSONSUBSTATE[CARD_PERSOSUBSTATE_UNKNOWN] = GECKO_CARDSTATE_UNKNOWN; @@ -2366,12 +2378,12 @@ PERSONSUBSTATE[CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK] = GECKO_CARDSTATE_SE PERSONSUBSTATE[CARD_PERSOSUBSTATE_READY] = GECKO_CARDSTATE_READY; this.GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK = {}; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["nck"] = CARD_PERSOSUBSTATE_SIM_NETWORK; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["cck"] = CARD_PERSOSUBSTATE_SIM_CORPORATE; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["spck"] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["nckPuk"] = CARD_PERSOSUBSTATE_SIM_NETWORK_PUK; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["cckPuk"] = CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK; -GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK["spckPuk"] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK] = CARD_PERSOSUBSTATE_SIM_NETWORK; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_CCK] = CARD_PERSOSUBSTATE_SIM_CORPORATE; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_SPCK] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_NCK_PUK] = CARD_PERSOSUBSTATE_SIM_NETWORK_PUK; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_CCK_PUK] = CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK; +GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[GECKO_CARDLOCK_SPCK_PUK] = CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK; this.GECKO_NETWORK_SELECTION_UNKNOWN = null; this.GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic"; diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index fd88f44d59d4..781edae56c8a 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -967,28 +967,28 @@ let RIL = { */ iccUnlockCardLock: function iccUnlockCardLock(options) { switch (options.lockType) { - case "pin": + case GECKO_CARDLOCK_PIN: this.enterICCPIN(options); break; - case "pin2": + case GECKO_CARDLOCK_PIN2: this.enterICCPIN2(options); break; - case "puk": + case GECKO_CARDLOCK_PUK: this.enterICCPUK(options); break; - case "puk2": + case GECKO_CARDLOCK_PUK2: this.enterICCPUK2(options); break; - case "nck": - case "cck": // Fall through. - case "spck": { + case GECKO_CARDLOCK_NCK: + case GECKO_CARDLOCK_CCK: // Fall through. + case GECKO_CARDLOCK_SPCK: { let type = GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[options.lockType]; this.enterDepersonalization(type, options.pin, options); break; } - case "nckPuk": - case "cckPuk": // Fall through. - case "spckPuk": { + case GECKO_CARDLOCK_NCK_PUK: + case GECKO_CARDLOCK_CCK_PUK: // Fall through. + case GECKO_CARDLOCK_SPCK_PUK: { let type = GECKO_PERSO_LOCK_TO_CARD_PERSO_LOCK[options.lockType]; this.enterDepersonalization(type, options.puk, options); break; @@ -1057,10 +1057,10 @@ let RIL = { iccSetCardLock: function iccSetCardLock(options) { if (options.newPin !== undefined) { // Change PIN lock. switch (options.lockType) { - case "pin": + case GECKO_CARDLOCK_PIN: this.changeICCPIN(options); break; - case "pin2": + case GECKO_CARDLOCK_PIN2: this.changeICCPIN2(options); break; default: @@ -1070,11 +1070,11 @@ let RIL = { } } else { // Enable/Disable lock. switch (options.lockType) { - case "pin": + case GECKO_CARDLOCK_PIN: options.facility = ICC_CB_FACILITY_SIM; options.password = options.pin; break; - case "fdn": + case GECKO_CARDLOCK_FDN: options.facility = ICC_CB_FACILITY_FDN; options.password = options.pin2; break; @@ -1180,10 +1180,10 @@ let RIL = { */ iccGetCardLockState: function iccGetCardLockState(options) { switch (options.lockType) { - case "pin": + case GECKO_CARDLOCK_PIN: options.facility = ICC_CB_FACILITY_SIM; break; - case "fdn": + case GECKO_CARDLOCK_FDN: options.facility = ICC_CB_FACILITY_FDN; break; default: