1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 [Pref="dom.icc.enabled"]
8 interface MozIcc : EventTarget
10 // Integrated Circuit Card Information.
13 * Information stored in the device's ICC.
15 * Once the ICC becomes undetectable, iccinfochange event will be notified.
16 * Also, the attribute is set to null and this MozIcc object becomes invalid.
17 * Calling asynchronous functions raises exception then.
19 readonly attribute MozIccInfo? iccInfo;
22 * The 'iccinfochange' event is notified whenever the icc info object
25 attribute EventHandler oniccinfochange;
27 // Integrated Circuit Card State.
30 * Indicates the state of the device's ICC.
32 * Possible values: 'illegal', 'unknown', 'pinRequired', 'pukRequired',
33 * 'personalizationInProgress', 'networkLocked', 'network1Locked',
34 * 'network2Locked', 'hrpdNetworkLocked', 'corporateLocked',
35 * 'serviceProviderLocked', 'ruimCorporateLocked', 'ruimServiceProviderLocked',
36 * 'networkPukRequired', 'network1PukRequired', 'network2PukRequired',
37 * 'hrpdNetworkPukRequired', 'corporatePukRequired',
38 * 'serviceProviderPukRequired', 'ruimCorporatePukRequired',
39 * 'ruimServiceProviderPukRequired', 'personalizationReady', 'ready',
42 * Once the ICC becomes undetectable, cardstatechange event will be notified.
43 * Also, the attribute is set to null and this MozIcc object becomes invalid.
44 * Calling asynchronous functions raises exception then.
46 readonly attribute DOMString? cardState;
49 * The 'cardstatechange' event is notified when the 'cardState' attribute
52 attribute EventHandler oncardstatechange;
54 // Integrated Circuit Card STK.
57 * Send the response back to ICC after an attempt to execute STK proactive
61 * Command received from ICC. See MozStkCommand.
63 * The response that will be sent to ICC.
64 * @see MozStkResponse for the detail of response.
67 void sendStkResponse(any command, any response);
70 * Send the "Menu Selection" envelope command to ICC for menu selection.
72 * @param itemIdentifier
73 * The identifier of the item selected by user.
74 * @param helpRequested
75 * true if user requests to provide help information, false otherwise.
78 void sendStkMenuSelection(unsigned short itemIdentifier,
79 boolean helpRequested);
82 * Send the "Timer Expiration" envelope command to ICC for TIMER MANAGEMENT.
85 * The identifier and value for a timer.
86 * timerId: Identifier of the timer that has expired.
87 * timerValue: Different between the time when this command is issued
88 * and when the timer was initially started.
92 void sendStkTimerExpiration(any timer);
95 * Send "Event Download" envelope command to ICC.
96 * ICC will not respond with any data for this command.
99 * one of events below:
100 * - MozStkLocationEvent
102 * - MozStkLanguageSelectionEvent
103 * - MozStkGeneralEvent
104 * - MozStkBrowserTerminationEvent
107 void sendStkEventDownload(any event);
110 * The 'stkcommand' event is notified whenever STK proactive command is
113 attribute EventHandler onstkcommand;
116 * 'stksessionend' event is notified whenever STK session is terminated by
119 attribute EventHandler onstksessionend;
121 // Integrated Circuit Card Lock interfaces.
124 * Find out about the status of an ICC lock (e.g. the PIN lock).
127 * Identifies the lock type, e.g. "pin" for the PIN lock, "fdn" for
130 * @return a DOMRequest.
131 * The request's result will be an object containing
132 * information about the specified lock's status,
133 * e.g. {lockType: "pin", enabled: true}.
136 DOMRequest getCardLock(DOMString lockType);
139 * Unlock a card lock.
142 * An object containing the information necessary to unlock
143 * the given lock. At a minimum, this object must have a
144 * "lockType" attribute which specifies the type of lock, e.g.
145 * "pin" for the PIN lock. Other attributes are dependent on
150 * (1) Unlocking the PIN:
152 * unlockCardLock({lockType: "pin",
155 * (2) Unlocking the PUK and supplying a new PIN:
157 * unlockCardLock({lockType: "puk",
161 * (3) Network depersonalization. Unlocking the network control key (NCK).
163 * unlockCardLock({lockType: "nck",
166 * (4) Network type 1 depersonalization. Unlocking the network type 1 control
169 * unlockCardLock({lockType: "nck1",
172 * (5) Network type 2 depersonalization. Unlocking the network type 2 control
175 * unlockCardLock({lockType: "nck2",
178 * (6) HRPD network depersonalization. Unlocking the HRPD network control key
181 * unlockCardLock({lockType: "hnck",
184 * (7) Corporate depersonalization. Unlocking the corporate control key (CCK).
186 * unlockCardLock({lockType: "cck",
189 * (8) Service provider depersonalization. Unlocking the service provider
190 * control key (SPCK).
192 * unlockCardLock({lockType: "spck",
195 * (9) RUIM corporate depersonalization. Unlocking the RUIM corporate control
198 * unlockCardLock({lockType: "rcck",
201 * (10) RUIM service provider depersonalization. Unlocking the RUIM service
202 * provider control key (RSPCK).
204 * unlockCardLock({lockType: "rspck",
207 * (11) Network PUK depersonalization. Unlocking the network control key (NCK).
209 * unlockCardLock({lockType: "nckPuk",
212 * (12) Network type 1 PUK depersonalization. Unlocking the network type 1
213 * control key (NCK1).
215 * unlockCardLock({lockType: "nck1Puk",
218 * (13) Network type 2 PUK depersonalization. Unlocking the Network type 2
219 * control key (NCK2).
221 * unlockCardLock({lockType: "nck2Puk",
224 * (14) HRPD network PUK depersonalization. Unlocking the HRPD network control
227 * unlockCardLock({lockType: "hnckPuk",
230 * (15) Corporate PUK depersonalization. Unlocking the corporate control key
233 * unlockCardLock({lockType: "cckPuk",
236 * (16) Service provider PUK depersonalization. Unlocking the service provider
237 * control key (SPCK).
239 * unlockCardLock({lockType: "spckPuk",
242 * (17) RUIM corporate PUK depersonalization. Unlocking the RUIM corporate
243 * control key (RCCK).
245 * unlockCardLock({lockType: "rcckPuk",
248 * (18) RUIM service provider PUK depersonalization. Unlocking the service
249 * provider control key (SPCK).
251 * unlockCardLock({lockType: "rspckPuk",
254 * @return a DOMRequest.
255 * The request's result will be an object containing
256 * information about the unlock operation.
260 * (1) Unlocking failed:
268 * (2) Unlocking succeeded:
276 DOMRequest unlockCardLock(any info);
279 * Modify the state of a card lock.
282 * An object containing information about the lock and
283 * how to modify its state. At a minimum, this object
284 * must have a "lockType" attribute which specifies the
285 * type of lock, e.g. "pin" for the PIN lock. Other
286 * attributes are dependent on the lock type.
290 * (1a) Disabling the PIN lock:
292 * setCardLock({lockType: "pin",
296 * (1b) Disabling the FDN lock:
298 * setCardLock({lockType: "fdn",
302 * (2) Changing the PIN:
304 * setCardLock({lockType: "pin",
308 * @return a DOMRequest.
309 * The request's result will be an object containing
310 * information about the operation.
314 * (1) Enabling/Disabling card lock failed or change card lock failed.
322 * (2) Enabling/Disabling card lock succeed or change card lock succeed.
330 DOMRequest setCardLock(any info);
333 * Retrieve the number of remaining tries for unlocking the card.
336 * Identifies the lock type, e.g. "pin" for the PIN lock, "puk" for
339 * @return a DOMRequest.
340 * If the lock type is "pin", or "puk", the request's result will be
341 * an object containing the number of retries for the specified
342 * lock. For any other lock type, the result is undefined.
345 DOMRequest getCardLockRetryCount(DOMString lockType);
347 // Integrated Circuit Card Phonebook Interfaces.
353 * One of type as below,
354 * - 'adn': Abbreviated Dialling Number.
355 * - 'fdn': Fixed Dialling Number.
356 * - 'sdn': Service Dialling Number.
358 * @return a DOMRequest.
361 DOMRequest readContacts(DOMString contactType);
364 * Update ICC Phonebook contact.
367 * One of type as below,
368 * - 'adn': Abbreviated Dialling Number.
369 * - 'fdn': Fixed Dialling Number.
371 * The contact will be updated in ICC.
372 * @param [optional] pin2
373 * PIN2 is only required for 'fdn'.
375 * @return a DOMRequest.
378 DOMRequest updateContact(DOMString contactType,
380 optional DOMString? pin2 = null);
382 // Integrated Circuit Card Secure Element Interfaces.
385 * A secure element is a smart card chip that can hold
386 * several different applications with the necessary security.
387 * The most known secure element is the Universal Integrated Circuit Card
392 * Send request to open a logical channel defined by its
393 * application identifier (AID).
396 * The application identifier of the applet to be selected on this
399 * @return a DOMRequest.
400 * The request's result will be an instance of channel (channelID)
401 * if available or null.
404 DOMRequest iccOpenChannel(DOMString aid);
407 * Interface, used to communicate with an applet through the
408 * application data protocol units (APDUs) and is
409 * used for all data that is exchanged between the UICC and the terminal (ME).
412 * The application identifier of the applet to which APDU is directed.
414 * Application protocol data unit.
416 * @return a DOMRequest.
417 * The request's result will be response APDU.
420 DOMRequest iccExchangeAPDU(long channel, any apdu);
423 * Send request to close the selected logical channel identified by its
424 * application identifier (AID).
427 * The application identifier of the applet, to be closed.
429 * @return a DOMRequest.
432 DOMRequest iccCloseChannel(long channel);
434 // Integrated Circuit Card Helpers.
437 * Verify whether the passed data (matchData) matches with some ICC's field
438 * according to the mvno type (mvnoType).
441 * Mvno type to use to compare the match data.
442 * Currently, we only support 'imsi'.
444 * Data to be compared with ICC's field.
446 * @return a DOMRequest.
447 * The request's result will be a boolean indicating the matching
450 * TODO: change param mvnoType to WebIDL enum after Bug 864489 -
451 * B2G RIL: use ipdl as IPC in MozIccManager
454 DOMRequest matchMvno(DOMString mvnoType, DOMString matchData);