diff --git a/dom/network/interfaces/nsIDOMMobileConnection.idl b/dom/network/interfaces/nsIDOMMobileConnection.idl index 6c5a4732b2b7..12bd76d6fa0e 100644 --- a/dom/network/interfaces/nsIDOMMobileConnection.idl +++ b/dom/network/interfaces/nsIDOMMobileConnection.idl @@ -119,7 +119,12 @@ interface nsIDOMMozMobileConnection : nsIDOMEventTarget * unlockCardLock({lockType: "pin", * pin: "..."}); * - * (2) Unlocking the PUK and supplying a new PIN: + * (2) Network depersonalization. Unlocking the network control key (NCK). + * + * unlockCardLock({lockType: "nck", + * pin: "..."}); + * + * (3) Unlocking the PUK and supplying a new PIN: * * unlockCardLock({lockType: "puk", * puk: "...", diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 2ec8b92fc178..01b749b6c1eb 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -28,7 +28,7 @@ const REQUEST_ENTER_SIM_PIN2 = 4; const REQUEST_ENTER_SIM_PUK2 = 5; const REQUEST_CHANGE_SIM_PIN = 6; const REQUEST_CHANGE_SIM_PIN2 = 7; -const REQUEST_ENTER_NETWORK_DEPERSONALIZATION = 8; +const REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE = 8; const REQUEST_GET_CURRENT_CALLS = 9; const REQUEST_DIAL = 10; const REQUEST_GET_IMSI = 11; diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index c84728fcd94d..c8323b7c6103 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -812,6 +812,10 @@ let RIL = { case "puk2": this.enterICCPUK2(options); break; + case "nck": + options.type = CARD_PERSOSUBSTATE_SIM_NETWORK; + this.enterDepersonalization(options); + break; default: options.errorMsg = "Unsupported Card Lock."; options.success = false; @@ -855,6 +859,21 @@ let RIL = { Buf.sendParcel(); }, + /** + * Requests a network personalization be deactivated. + * + * @param type + * Integer indicating the network personalization be deactivated. + * @param pin + * String containing the pin. + */ + enterDepersonalization: function enterDepersonalization(options) { + Buf.newParcel(REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE, options); + Buf.writeUint32(options.type); + Buf.writeString(options.pin); + Buf.sendParcel(); + }, + /** * Helper function for changing ICC locks. */ @@ -3699,7 +3718,10 @@ RIL[REQUEST_CHANGE_SIM_PIN] = function REQUEST_CHANGE_SIM_PIN(length, options) { RIL[REQUEST_CHANGE_SIM_PIN2] = function REQUEST_CHANGE_SIM_PIN2(length, options) { this._processEnterAndChangeICCResponses(length, options); }; -RIL[REQUEST_ENTER_NETWORK_DEPERSONALIZATION] = null; +RIL[REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE] = + function REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE(length, options) { + this._processEnterAndChangeICCResponses(length, options); +}; RIL[REQUEST_GET_CURRENT_CALLS] = function REQUEST_GET_CURRENT_CALLS(length, options) { if (options.rilRequestError) { return;