2013-10-09 01:02:59 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
interface MozIccInfo;
|
|
|
|
|
|
|
|
[Pref="dom.icc.enabled"]
|
|
|
|
interface MozIcc : EventTarget
|
|
|
|
{
|
|
|
|
// Integrated Circuit Card Information.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Information stored in the device's ICC.
|
|
|
|
*
|
|
|
|
* Once the ICC becomes undetectable, iccinfochange event will be notified.
|
|
|
|
* Also, the attribute is set to null and this MozIcc object becomes invalid.
|
|
|
|
* Calling asynchronous functions raises exception then.
|
|
|
|
*/
|
|
|
|
readonly attribute MozIccInfo? iccInfo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'iccinfochange' event is notified whenever the icc info object
|
|
|
|
* changes.
|
|
|
|
*/
|
|
|
|
attribute EventHandler oniccinfochange;
|
|
|
|
|
|
|
|
// Integrated Circuit Card State.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the state of the device's ICC.
|
|
|
|
*
|
2014-09-05 03:12:10 -07:00
|
|
|
* Possible values: 'illegal', 'unknown', 'pinRequired', 'pukRequired',
|
|
|
|
* 'personalizationInProgress', 'networkLocked', 'network1Locked',
|
|
|
|
* 'network2Locked', 'hrpdNetworkLocked', 'corporateLocked',
|
|
|
|
* 'serviceProviderLocked', 'ruimCorporateLocked', 'ruimServiceProviderLocked',
|
|
|
|
* 'networkPukRequired', 'network1PukRequired', 'network2PukRequired',
|
|
|
|
* 'hrpdNetworkPukRequired', 'corporatePukRequired',
|
|
|
|
* 'serviceProviderPukRequired', 'ruimCorporatePukRequired',
|
|
|
|
* 'ruimServiceProviderPukRequired', 'personalizationReady', 'ready',
|
|
|
|
* 'permanentBlocked'.
|
|
|
|
*
|
2013-10-09 01:02:59 -07:00
|
|
|
* Once the ICC becomes undetectable, cardstatechange event will be notified.
|
|
|
|
* Also, the attribute is set to null and this MozIcc object becomes invalid.
|
|
|
|
* Calling asynchronous functions raises exception then.
|
|
|
|
*/
|
2014-09-05 03:12:10 -07:00
|
|
|
readonly attribute DOMString? cardState;
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'cardstatechange' event is notified when the 'cardState' attribute
|
|
|
|
* changes value.
|
|
|
|
*/
|
|
|
|
attribute EventHandler oncardstatechange;
|
|
|
|
|
|
|
|
// Integrated Circuit Card STK.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send the response back to ICC after an attempt to execute STK proactive
|
|
|
|
* Command.
|
|
|
|
*
|
|
|
|
* @param command
|
|
|
|
* Command received from ICC. See MozStkCommand.
|
|
|
|
* @param response
|
|
|
|
* The response that will be sent to ICC.
|
|
|
|
* @see MozStkResponse for the detail of response.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void sendStkResponse(any command, any response);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send the "Menu Selection" envelope command to ICC for menu selection.
|
|
|
|
*
|
|
|
|
* @param itemIdentifier
|
|
|
|
* The identifier of the item selected by user.
|
|
|
|
* @param helpRequested
|
|
|
|
* true if user requests to provide help information, false otherwise.
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void sendStkMenuSelection(unsigned short itemIdentifier,
|
|
|
|
boolean helpRequested);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send the "Timer Expiration" envelope command to ICC for TIMER MANAGEMENT.
|
|
|
|
*
|
|
|
|
* @param timer
|
|
|
|
* The identifier and value for a timer.
|
|
|
|
* timerId: Identifier of the timer that has expired.
|
|
|
|
* timerValue: Different between the time when this command is issued
|
|
|
|
* and when the timer was initially started.
|
|
|
|
* @see MozStkTimer
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void sendStkTimerExpiration(any timer);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send "Event Download" envelope command to ICC.
|
|
|
|
* ICC will not respond with any data for this command.
|
|
|
|
*
|
|
|
|
* @param event
|
|
|
|
* one of events below:
|
|
|
|
* - MozStkLocationEvent
|
|
|
|
* - MozStkCallEvent
|
|
|
|
* - MozStkLanguageSelectionEvent
|
|
|
|
* - MozStkGeneralEvent
|
|
|
|
* - MozStkBrowserTerminationEvent
|
|
|
|
*/
|
|
|
|
[Throws]
|
|
|
|
void sendStkEventDownload(any event);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The 'stkcommand' event is notified whenever STK proactive command is
|
|
|
|
* issued from ICC.
|
|
|
|
*/
|
|
|
|
attribute EventHandler onstkcommand;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 'stksessionend' event is notified whenever STK session is terminated by
|
|
|
|
* ICC.
|
|
|
|
*/
|
|
|
|
attribute EventHandler onstksessionend;
|
|
|
|
|
|
|
|
// Integrated Circuit Card Lock interfaces.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Find out about the status of an ICC lock (e.g. the PIN lock).
|
|
|
|
*
|
|
|
|
* @param lockType
|
|
|
|
* Identifies the lock type, e.g. "pin" for the PIN lock, "fdn" for
|
|
|
|
* the FDN lock.
|
|
|
|
*
|
|
|
|
* @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}.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest getCardLock(DOMString lockType);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Unlock a card lock.
|
|
|
|
*
|
|
|
|
* @param info
|
|
|
|
* An object containing the information necessary to unlock
|
|
|
|
* the given lock. At a minimum, this object must have a
|
|
|
|
* "lockType" attribute which specifies the type of lock, e.g.
|
|
|
|
* "pin" for the PIN lock. Other attributes are dependent on
|
|
|
|
* the lock type.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1) Unlocking the PIN:
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "pin",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (2) Unlocking the PUK and supplying a new PIN:
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "puk",
|
|
|
|
* puk: "...",
|
|
|
|
* newPin: "..."});
|
|
|
|
*
|
|
|
|
* (3) Network depersonalization. Unlocking the network control key (NCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (4) Network type 1 depersonalization. Unlocking the network type 1 control
|
|
|
|
* key (NCK1).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck1",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (5) Network type 2 depersonalization. Unlocking the network type 2 control
|
|
|
|
* key (NCK2).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck2",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (6) HRPD network depersonalization. Unlocking the HRPD network control key
|
|
|
|
* (HNCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "hnck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (7) Corporate depersonalization. Unlocking the corporate control key (CCK).
|
2013-10-09 01:02:59 -07:00
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "cck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (8) Service provider depersonalization. Unlocking the service provider
|
2013-10-09 01:02:59 -07:00
|
|
|
* control key (SPCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "spck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (9) RUIM corporate depersonalization. Unlocking the RUIM corporate control
|
|
|
|
* key (RCCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "rcck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (10) RUIM service provider depersonalization. Unlocking the RUIM service
|
|
|
|
* provider control key (RSPCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "rspck",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (11) Network PUK depersonalization. Unlocking the network control key (NCK).
|
2013-10-09 01:02:59 -07:00
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nckPuk",
|
|
|
|
* puk: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (12) Network type 1 PUK depersonalization. Unlocking the network type 1
|
|
|
|
* control key (NCK1).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck1Puk",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (13) Network type 2 PUK depersonalization. Unlocking the Network type 2
|
|
|
|
* control key (NCK2).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "nck2Puk",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (14) HRPD network PUK depersonalization. Unlocking the HRPD network control
|
|
|
|
* key (HNCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "hnckPuk",
|
|
|
|
* pin: "..."});
|
|
|
|
*
|
|
|
|
* (15) Corporate PUK depersonalization. Unlocking the corporate control key
|
|
|
|
* (CCK).
|
2013-10-09 01:02:59 -07:00
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "cckPuk",
|
|
|
|
* puk: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (16) Service provider PUK depersonalization. Unlocking the service provider
|
|
|
|
* control key (SPCK).
|
2013-10-09 01:02:59 -07:00
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "spckPuk",
|
|
|
|
* puk: "..."});
|
|
|
|
*
|
2014-02-19 22:00:56 -08:00
|
|
|
* (17) RUIM corporate PUK depersonalization. Unlocking the RUIM corporate
|
|
|
|
* control key (RCCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "rcckPuk",
|
|
|
|
* puk: "..."});
|
|
|
|
*
|
|
|
|
* (18) RUIM service provider PUK depersonalization. Unlocking the service
|
|
|
|
* provider control key (SPCK).
|
|
|
|
*
|
|
|
|
* unlockCardLock({lockType: "rspckPuk",
|
|
|
|
* puk: "..."});
|
|
|
|
*
|
2013-10-09 01:02:59 -07:00
|
|
|
* @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
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest unlockCardLock(any info);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modify the state of a card lock.
|
|
|
|
*
|
|
|
|
* @param info
|
|
|
|
* An object containing information about the lock and
|
|
|
|
* how to modify its state. At a minimum, this object
|
|
|
|
* must have a "lockType" attribute which specifies the
|
|
|
|
* type of lock, e.g. "pin" for the PIN lock. Other
|
|
|
|
* attributes are dependent on the lock type.
|
|
|
|
*
|
|
|
|
* Examples:
|
|
|
|
*
|
|
|
|
* (1a) Disabling the PIN lock:
|
|
|
|
*
|
|
|
|
* setCardLock({lockType: "pin",
|
|
|
|
* pin: "...",
|
|
|
|
* enabled: false});
|
|
|
|
*
|
|
|
|
* (1b) Disabling the FDN lock:
|
|
|
|
*
|
|
|
|
* setCardLock({lockType: "fdn",
|
|
|
|
* pin2: "...",
|
|
|
|
* enabled: false});
|
|
|
|
*
|
|
|
|
* (2) Changing the PIN:
|
|
|
|
*
|
|
|
|
* setCardLock({lockType: "pin",
|
|
|
|
* pin: "...",
|
|
|
|
* 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
|
|
|
|
* }
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest setCardLock(any info);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve the number of remaining tries for unlocking the card.
|
|
|
|
*
|
|
|
|
* @param lockType
|
|
|
|
* Identifies the lock type, e.g. "pin" for the PIN lock, "puk" for
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest getCardLockRetryCount(DOMString lockType);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
// Integrated Circuit Card Phonebook Interfaces.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Read ICC contacts.
|
|
|
|
*
|
|
|
|
* @param contactType
|
|
|
|
* One of type as below,
|
|
|
|
* - 'adn': Abbreviated Dialling Number.
|
|
|
|
* - 'fdn': Fixed Dialling Number.
|
2014-05-15 23:50:00 -07:00
|
|
|
* - 'sdn': Service Dialling Number.
|
2013-10-09 01:02:59 -07:00
|
|
|
*
|
|
|
|
* @return a DOMRequest.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest readContacts(DOMString contactType);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Update ICC Phonebook contact.
|
|
|
|
*
|
|
|
|
* @param contactType
|
|
|
|
* One of type as below,
|
|
|
|
* - 'adn': Abbreviated Dialling Number.
|
|
|
|
* - 'fdn': Fixed Dialling Number.
|
|
|
|
* @param contact
|
|
|
|
* The contact will be updated in ICC.
|
|
|
|
* @param [optional] pin2
|
|
|
|
* PIN2 is only required for 'fdn'.
|
|
|
|
*
|
|
|
|
* @return a DOMRequest.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest updateContact(DOMString contactType,
|
2013-10-09 01:02:59 -07:00
|
|
|
any contact,
|
|
|
|
optional DOMString? pin2 = null);
|
|
|
|
|
|
|
|
// Integrated Circuit Card Secure Element Interfaces.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A secure element is a smart card chip that can hold
|
|
|
|
* several different applications with the necessary security.
|
|
|
|
* The most known secure element is the Universal Integrated Circuit Card
|
|
|
|
* (UICC).
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send request to open a logical channel defined by its
|
|
|
|
* application identifier (AID).
|
|
|
|
*
|
|
|
|
* @param aid
|
|
|
|
* The application identifier of the applet to be selected on this
|
|
|
|
* channel.
|
|
|
|
*
|
|
|
|
* @return a DOMRequest.
|
|
|
|
* The request's result will be an instance of channel (channelID)
|
|
|
|
* if available or null.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest iccOpenChannel(DOMString aid);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface, used to communicate with an applet through the
|
|
|
|
* application data protocol units (APDUs) and is
|
|
|
|
* used for all data that is exchanged between the UICC and the terminal (ME).
|
|
|
|
*
|
|
|
|
* @param channel
|
|
|
|
* The application identifier of the applet to which APDU is directed.
|
|
|
|
* @param apdu
|
|
|
|
* Application protocol data unit.
|
|
|
|
*
|
|
|
|
* @return a DOMRequest.
|
|
|
|
* The request's result will be response APDU.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest iccExchangeAPDU(long channel, any apdu);
|
2013-10-09 01:02:59 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Send request to close the selected logical channel identified by its
|
|
|
|
* application identifier (AID).
|
|
|
|
*
|
|
|
|
* @param aid
|
|
|
|
* The application identifier of the applet, to be closed.
|
|
|
|
*
|
|
|
|
* @return a DOMRequest.
|
|
|
|
*/
|
|
|
|
[Throws]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest iccCloseChannel(long channel);
|
2014-01-28 15:15:00 -08:00
|
|
|
|
|
|
|
// Integrated Circuit Card Helpers.
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Verify whether the passed data (matchData) matches with some ICC's field
|
|
|
|
* according to the mvno type (mvnoType).
|
|
|
|
*
|
|
|
|
* @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]
|
2014-05-19 13:37:58 -07:00
|
|
|
DOMRequest matchMvno(DOMString mvnoType, DOMString matchData);
|
2013-10-09 01:02:59 -07:00
|
|
|
};
|