Bug 772357 - B2G RIL: Support network depersonalization. r=philikon

This commit is contained in:
Jose Antonio Olivera Ortega 2012-09-28 12:46:47 +02:00
parent 6b50650db5
commit 952e98bb47
3 changed files with 30 additions and 3 deletions

View File

@ -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: "...",

View File

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

View File

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