Bug 1083745 - Part 3: Remove the redundant information carried in request result of icc.{set|get|unlock}CardLock API. r=hsinyi

This commit is contained in:
Edgar Chen 2014-10-29 11:42:13 +08:00
Родитель 4dca680354
Коммит 7d651c7b78
2 изменённых файлов: 21 добавлений и 65 удалений

Просмотреть файл

@ -75,19 +75,6 @@ XPCOMUtils.defineLazyGetter(this, "gNumRadioInterfaces", function() {
return Services.prefs.getIntPref(kPrefRilNumRadioInterfaces);
});
function MobileIccCardLockResult(options) {
this.lockType = options.lockType;
this.enabled = options.enabled;
this.retryCount = options.retryCount;
this.success = options.success;
}
function MobileIccCardLockRetryCount(options) {
this.lockType = options.lockType;
this.retryCount = options.retryCount;
this.success = options.success;
}
function IccInfo() {}
IccInfo.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIIccInfo]),
@ -674,8 +661,9 @@ RILContentHelper.prototype = {
break;
}
let result = new MobileIccCardLockResult(data);
this.fireRequestSuccess(requestId, Cu.cloneInto(result, requestWindow));
this.fireRequestSuccess(requestId,
Cu.cloneInto({ enabled: data.enabled },
requestWindow));
break;
}
case "RIL:SetUnlockCardLockResult": {
@ -690,8 +678,7 @@ RILContentHelper.prototype = {
break;
}
let result = new MobileIccCardLockResult(data);
this.fireRequestSuccess(requestId, Cu.cloneInto(result, requestWindow));
this.fireRequestSuccess(requestId, null);
break;
}
case "RIL:CardLockRetryCount": {
@ -704,8 +691,9 @@ RILContentHelper.prototype = {
break;
}
let result = new MobileIccCardLockRetryCount(data);
this.fireRequestSuccess(data.requestId, Cu.cloneInto(result, requestWindow));
this.fireRequestSuccess(data.requestId,
Cu.cloneInto({ retryCount: data.retryCount },
requestWindow));
break;
}
case "RIL:StkCommand":

Просмотреть файл

@ -164,8 +164,8 @@ interface MozIcc : EventTarget
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the specified lock's status,
* e.g. {lockType: "pin", enabled: true}.
* information about the specified lock's status.
* e.g. {enabled: true}.
*/
[Throws]
DOMRequest getCardLock(DOMString lockType);
@ -248,19 +248,19 @@ interface MozIcc : EventTarget
* control key (NCK1).
*
* unlockCardLock({lockType: "nck1Puk",
* pin: "..."});
* puk: "..."});
*
* (13) Network type 2 PUK depersonalization. Unlocking the Network type 2
* control key (NCK2).
*
* unlockCardLock({lockType: "nck2Puk",
* pin: "..."});
* puk: "..."});
*
* (14) HRPD network PUK depersonalization. Unlocking the HRPD network control
* key (HNCK).
*
* unlockCardLock({lockType: "hnckPuk",
* pin: "..."});
* puk: "..."});
*
* (15) Corporate PUK depersonalization. Unlocking the corporate control key
* (CCK).
@ -287,25 +287,9 @@ interface MozIcc : EventTarget
* puk: "..."});
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the unlock operation.
*
* Examples:
*
* (1) Unlocking failed:
*
* {
* lockType: "pin",
* success: false,
* retryCount: 2
* }
*
* (2) Unlocking succeeded:
*
* {
* lockType: "pin",
* success: true
* }
* The request's error will be an object containing the number of
* remaining retries
* @see IccCardLockError.
*/
[Throws]
DOMRequest unlockCardLock(any info);
@ -341,25 +325,9 @@ interface MozIcc : EventTarget
* newPin: "..."});
*
* @return a DOMRequest.
* The request's result will be an object containing
* information about the operation.
*
* Examples:
*
* (1) Enabling/Disabling card lock failed or change card lock failed.
*
* {
* lockType: "pin",
* success: false,
* retryCount: 2
* }
*
* (2) Enabling/Disabling card lock succeed or change card lock succeed.
*
* {
* lockType: "pin",
* success: true
* }
* The request's error will be an object containing the number of
* remaining retries.
* @see IccCardLockError.
*/
[Throws]
DOMRequest setCardLock(any info);
@ -372,9 +340,9 @@ interface MozIcc : EventTarget
* the PUK lock.
*
* @return a DOMRequest.
* If the lock type is "pin", or "puk", the request's result will be
* an object containing the number of retries for the specified
* lock. For any other lock type, the result is undefined.
* The request's result will be an object containing the number of
* remaining retries.
* e.g. {retryCount: 3}.
*/
[Throws]
DOMRequest getCardLockRetryCount(DOMString lockType);