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 "unknown", // ICC card state is either not yet reported from modem or in an
15 * Personalization States
17 "personalizationInProgress",
18 "personalizationReady",
20 // SIM Personalization States.
22 "networkSubsetLocked",
24 "serviceProviderLocked",
25 "simPersonalizationLocked",
27 "networkSubsetPukRequired",
28 "corporatePukRequired",
29 "serviceProviderPukRequired",
30 "simPersonalizationPukRequired",
32 // RUIM Personalization States.
36 "ruimCorporateLocked",
37 "ruimServiceProviderLocked",
38 "ruimPersonalizationLocked",
39 "network1PukRequired",
40 "network2PukRequired",
41 "hrpdNetworkPukRequired",
42 "ruimCorporatePukRequired",
43 "ruimServiceProviderPukRequired",
44 "ruimPersonalizationPukRequired",
49 "illegal" // See Bug 916000. An owed pay card will be rejected by the network
50 // and fall in this state.
59 "nck", // Network depersonalization -- network control key (NCK).
60 "nsck", // Network subset depersonalization -- network subset control key (NSCK).
61 "nck1", // Network type 1 depersonalization -- network type 1 control key (NCK1).
62 "nck2", // Network type 2 depersonalization -- network type 2 control key (NCK2).
63 "hnck", // HRPD network depersonalization -- HRPD network control key (HNCK).
64 "cck", // Corporate depersonalization -- corporate control key (CCK).
65 "spck", // Service provider depersonalization -- service provider control key (SPCK).
66 "pck", // SIM depersonalization -- personalization control key (PCK).
67 "rcck", // RUIM corporate depersonalization -- RUIM corporate control key (RCCK).
68 "rspck", // RUIM service provider depersonalization -- RUIM service provider control key (RSPCK).
69 "nckPuk", // Network PUK depersonalization -- network control key (NCK).
70 "nsckPuk", // Network subset PUK depersonalization -- network subset control key (NSCK).
71 "nck1Puk", // Network type 1 PUK depersonalization -- network type 1 control key (NCK1).
72 "nck2Puk", // Network type 2 PUK depersonalization -- Network type 2 control key (NCK2).
73 "hnckPuk", // HRPD network PUK depersonalization -- HRPD network control key (HNCK).
74 "cckPuk", // Corporate PUK depersonalization -- corporate control key (CCK).
75 "spckPuk", // Service provider PUK depersonalization -- service provider control key (SPCK).
76 "pckPuk", // SIM PUK depersonalization -- personalization control key (PCK).
77 "rcckPuk", // RUIM corporate PUK depersonalization -- RUIM corporate control key (RCCK).
78 "rspckPuk", // RUIM service provider PUK depersonalization -- service provider control key (SPCK).
84 "adn", // Abbreviated Dialling Number.
85 "fdn", // Fixed Dialling Number.
86 "sdn" // Service Dialling Number.
101 dictionary IccUnlockCardLockOptions
103 required IccLockType lockType;
105 DOMString? pin = null; // Necessary for lock types: "pin", "pin2", "nck",
106 // "nsck", "nck1", "nck2", "hnck", "cck", "spck",
107 // "pck", "rcck", "rspck".
109 DOMString? puk = null; // Necessary for lock types: "puk", "puk2", "nckPuk",
110 // "nsckPuk", "nck1Puk", "nck2Puk", "hnckPuk", "cckPuk",
111 // "spckPuk", "pckPuk", "rcckPuk", "rspckPuk".
113 DOMString? newPin = null; // Necessary for lock types: "puk", "puk2".
116 dictionary IccSetCardLockOptions
118 required IccLockType lockType;
120 DOMString? pin = null; // Necessary for lock types: "pin", "pin2"
122 DOMString? pin2 = null; // Used for enabling/disabling operation.
123 // Necessary for lock types: "fdn".
125 DOMString? newPin = null; // Used for changing password operation.
126 // Necessary for lock types: "pin", "pin2"
128 boolean enabled; // Used for enabling/disabling operation.
129 // Necessary for lock types: "pin", "fdn"
132 [Pref="dom.icc.enabled"]
133 interface MozIcc : EventTarget
135 // Integrated Circuit Card Information.
138 * Information stored in the device's ICC.
140 * Once the ICC becomes undetectable, iccinfochange event will be notified.
141 * Also, the attribute is set to null and this MozIcc object becomes invalid.
142 * Calling asynchronous functions raises exception then.
144 readonly attribute (MozIccInfo or MozGsmIccInfo or MozCdmaIccInfo)? iccInfo;
147 * The 'iccinfochange' event is notified whenever the icc info object
150 attribute EventHandler oniccinfochange;
152 // Integrated Circuit Card State.
155 * Indicates the state of the device's ICC.
157 * Once the ICC becomes undetectable, cardstatechange event will be notified.
158 * Also, the attribute is set to null and this MozIcc object becomes invalid.
159 * Calling asynchronous functions raises exception then.
161 readonly attribute IccCardState? cardState;
164 * The 'cardstatechange' event is notified when the 'cardState' attribute
167 attribute EventHandler oncardstatechange;
169 // Integrated Circuit Card STK.
172 * Send the response back to ICC after an attempt to execute STK proactive
176 * Command received from ICC. See MozStkCommand.
178 * The response that will be sent to ICC.
179 * @see MozStkResponse for the detail of response.
182 void sendStkResponse(any command, any response);
185 * Send the "Menu Selection" envelope command to ICC for menu selection.
187 * @param itemIdentifier
188 * The identifier of the item selected by user.
189 * @param helpRequested
190 * true if user requests to provide help information, false otherwise.
193 void sendStkMenuSelection(unsigned short itemIdentifier,
194 boolean helpRequested);
197 * Send the "Timer Expiration" envelope command to ICC for TIMER MANAGEMENT.
200 * The identifier and value for a timer.
201 * timerId: Identifier of the timer that has expired.
202 * timerValue: Different between the time when this command is issued
203 * and when the timer was initially started.
207 void sendStkTimerExpiration(any timer);
210 * Send "Event Download" envelope command to ICC.
211 * ICC will not respond with any data for this command.
214 * one of events below:
215 * - MozStkLocationEvent
217 * - MozStkLanguageSelectionEvent
218 * - MozStkGeneralEvent
219 * - MozStkBrowserTerminationEvent
222 void sendStkEventDownload(any event);
225 * The 'stkcommand' event is notified whenever STK proactive command is
228 attribute EventHandler onstkcommand;
231 * 'stksessionend' event is notified whenever STK session is terminated by
234 attribute EventHandler onstksessionend;
236 // Integrated Circuit Card Lock interfaces.
239 * Find out about the status of an ICC lock (e.g. the PIN lock).
242 * Identifies the lock type.
244 * @return a DOMRequest.
245 * The request's result will be an object containing
246 * information about the specified lock's status.
247 * e.g. {enabled: true}.
250 DOMRequest getCardLock(IccLockType lockType);
253 * Unlock a card lock.
256 * An object containing the information necessary to unlock
259 * @return a DOMRequest.
260 * The request's error will be an object containing the number of
262 * @see IccCardLockError.
265 DOMRequest unlockCardLock(optional IccUnlockCardLockOptions info);
268 * Modify the state of a card lock.
271 * An object containing information about the lock and
272 * how to modify its state.
274 * @return a DOMRequest.
275 * The request's error will be an object containing the number of
277 * @see IccCardLockError.
280 DOMRequest setCardLock(optional IccSetCardLockOptions info);
283 * Retrieve the number of remaining tries for unlocking the card.
286 * Identifies the lock type.
288 * @return a DOMRequest.
289 * The request's result will be an object containing the number of
291 * e.g. {retryCount: 3}.
294 DOMRequest getCardLockRetryCount(IccLockType lockType);
296 // Integrated Circuit Card Phonebook Interfaces.
302 * Identifies the contact type.
304 * @return a DOMRequest.
307 DOMRequest readContacts(IccContactType contactType);
310 * Update ICC Phonebook contact.
313 * Identifies the contact type.
315 * The contact will be updated in ICC.
316 * @param pin2 [optional]
317 * PIN2 is only required for "fdn".
319 * @return a DOMRequest.
322 DOMRequest updateContact(IccContactType contactType,
324 optional DOMString? pin2 = null);
326 // Integrated Circuit Card Helpers.
329 * Verify whether the passed data (matchData) matches with some ICC's field
330 * according to the mvno type (mvnoType).
333 * Mvno type to use to compare the match data.
335 * Data to be compared with ICC's field.
337 * @return a DOMRequest.
338 * The request's result will be a boolean indicating the matching
342 DOMRequest matchMvno(IccMvnoType mvnoType, DOMString matchData);
345 * Retrieve the the availability of an icc service.
348 * Identifies the service type.
351 * If succeeds, the promise is resolved with boolean indicating the
352 * availability of the service. Otherwise, rejected with a DOMError.
355 Promise<boolean> getServiceState(IccService service);