forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
/
MozMobileConnection.webidl
669 lines (608 loc) · 21.4 KB
/
MozMobileConnection.webidl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
/* 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/. */
enum MobileNetworkSelectionMode {"automatic", "manual"};
enum MobileRadioState {"enabling", "enabled", "disabling", "disabled"};
enum MobileNetworkType {"gsm", "wcdma", "cdma", "evdo", "lte"};
enum MobilePreferredNetworkType {"wcdma/gsm", "gsm", "wcdma", "wcdma/gsm-auto",
"cdma/evdo", "cdma", "evdo",
"wcdma/gsm/cdma/evdo", "lte/cdma/evdo",
"lte/wcdma/gsm", "lte/wcdma/gsm/cdma/evdo",
"lte"};
enum MobileRoamingMode {"home", "affiliated", "any"};
[Pref="dom.mobileconnection.enabled"]
interface MozMobileConnection : EventTarget
{
const long ICC_SERVICE_CLASS_VOICE = 0x01; // (1 << 0)
const long ICC_SERVICE_CLASS_DATA = 0x02; // (1 << 1)
const long ICC_SERVICE_CLASS_FAX = 0x04; // (1 << 2)
const long ICC_SERVICE_CLASS_SMS = 0x08; // (1 << 3)
const long ICC_SERVICE_CLASS_DATA_SYNC = 0x10; // (1 << 4)
const long ICC_SERVICE_CLASS_DATA_ASYNC = 0x20; // (1 << 5)
const long ICC_SERVICE_CLASS_PACKET = 0x40; // (1 << 6)
const long ICC_SERVICE_CLASS_PAD = 0x80; // (1 << 7)
const long ICC_SERVICE_CLASS_MAX = 0x80; // (1 << 7)
/**
* Call forwarding action.
*
* @see 3GPP TS 27.007 7.11 "mode".
*/
const long CALL_FORWARD_ACTION_DISABLE = 0;
const long CALL_FORWARD_ACTION_ENABLE = 1;
const long CALL_FORWARD_ACTION_QUERY_STATUS = 2;
const long CALL_FORWARD_ACTION_REGISTRATION = 3;
const long CALL_FORWARD_ACTION_ERASURE = 4;
/**
* Call forwarding reason.
*
* @see 3GPP TS 27.007 7.11 "reason".
*/
const long CALL_FORWARD_REASON_UNCONDITIONAL = 0;
const long CALL_FORWARD_REASON_MOBILE_BUSY = 1;
const long CALL_FORWARD_REASON_NO_REPLY = 2;
const long CALL_FORWARD_REASON_NOT_REACHABLE = 3;
const long CALL_FORWARD_REASON_ALL_CALL_FORWARDING = 4;
const long CALL_FORWARD_REASON_ALL_CONDITIONAL_CALL_FORWARDING = 5;
/**
* Call barring program.
*/
const long CALL_BARRING_PROGRAM_ALL_OUTGOING = 0;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL = 1;
const long CALL_BARRING_PROGRAM_OUTGOING_INTERNATIONAL_EXCEPT_HOME = 2;
const long CALL_BARRING_PROGRAM_ALL_INCOMING = 3;
const long CALL_BARRING_PROGRAM_INCOMING_ROAMING = 4;
/**
* Calling line identification restriction constants.
*
* @see 3GPP TS 27.007 7.7 Defined values.
*/
const long CLIR_DEFAULT = 0;
const long CLIR_INVOCATION = 1;
const long CLIR_SUPPRESSION = 2;
/**
* These two fields can be accessed by privileged applications with the
* 'mobilenetwork' permission.
*/
[CheckPermissions="mobilenetwork"]
readonly attribute DOMString lastKnownNetwork;
[CheckPermissions="mobilenetwork"]
readonly attribute DOMString lastKnownHomeNetwork;
/**
* Information about the voice connection.
*/
[CheckPermissions="mobileconnection"]
readonly attribute MozMobileConnectionInfo voice;
/**
* Information about the data connection.
*/
[CheckPermissions="mobileconnection"]
readonly attribute MozMobileConnectionInfo data;
/**
* Integrated Circuit Card Identifier of the SIM this mobile connection
* corresponds to.
*/
[CheckPermissions="mobileconnection"]
readonly attribute DOMString? iccId;
/**
* The selection mode of the voice and data networks.
*/
[CheckPermissions="mobileconnection"]
readonly attribute MobileNetworkSelectionMode? networkSelectionMode;
/**
* The current radio state.
*/
[CheckPermissions="mobileconnection"]
readonly attribute MobileRadioState? radioState;
/**
* Array of network types that are supported by this radio.
*/
[Cached, Pure, CheckPermissions="mobileconnection"]
readonly attribute sequence<MobileNetworkType> supportedNetworkTypes;
/**
* Search for available networks.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an array of MozMobileNetworkInfo.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported', or
* 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getNetworks();
/**
* Manually selects the passed in network, overriding the radio's current
* selection.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
* Note: If the network was actually changed by this request,
* the 'voicechange' and 'datachange' events will also be fired.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest selectNetwork(MozMobileNetworkInfo network);
/**
* Tell the radio to automatically select a network.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
* Note: If the network was actually changed by this request, the
* 'voicechange' and 'datachange' events will also be fired.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest selectNetworkAutomatically();
/**
* Set preferred network type.
*
* @param type
* PreferredNetworkType indicates the desired preferred network type.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'ModeNotSupported', 'IllegalSIMorME', or
* 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setPreferredNetworkType(MobilePreferredNetworkType type);
/**
* Query current preferred network type.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a string indicating the current preferred network type.
* The value will be either 'wcdma/gsm', 'gsm', 'wcdma', 'wcdma/gsm-auto',
* 'cdma/evdo', 'cdma', 'evdo', 'wcdma/gsm/cdma/evdo', 'lte/cdma/evdo',
* 'lte/wcdma/gsm', 'lte/wcdma/gsm/cdma/evdo' or 'lte'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getPreferredNetworkType();
/**
* Set roaming preference.
*
* @param mode
* RoamingPreferenceMode indicates the desired roaming preference.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setRoamingPreference(MobileRoamingMode mode);
/**
* Query current roaming preference.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a string indicating the current roaming preference.
* The value will be either 'home', 'affiliated', or 'any'.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getRoamingPreference();
/**
* Set voice privacy preference.
*
* @param enabled
* Boolean indicates the preferred voice privacy mode used in voice
* scrambling in CDMA networks. 'True' means the enhanced voice security
* is required.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setVoicePrivacyMode(boolean enabled);
/**
* Query current voice privacy mode.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a boolean indicating the current voice privacy mode.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getVoicePrivacyMode();
/**
* Configures call forward options.
*
* @param options
* An object containing the call forward rule to set.
* @see MozCallForwardingOptions for the detail of options.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setCallForwardingOption(optional MozCallForwardingOptions options);
/**
* Queries current call forward options.
*
* @param reason
* Indicates the reason the call is being forwarded. It shall be one of
* the MozMobileConnection.CALL_FORWARD_REASON_* values.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an array of MozCallForwardingOptions.
* @see MozCallForwardingOptions for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getCallForwardingOption(unsigned short reason);
/**
* Configures call barring options.
*
* @param options
* An object containing the call barring rule to set.
* @see MozCallBarringOptions for the detail of options.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setCallBarringOption(optional MozCallBarringOptions options);
/**
* Queries current call barring status.
*
* @param options
* An object containing the call barring rule to query. No need to
* specify 'enabled' property.
* @see MozCallBarringOptions for the detail of options.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object of MozCallBarringOptions with correct 'enabled'
* property indicating the status of this rule.
* @see MozCallBarringOptions for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getCallBarringOption(optional MozCallBarringOptions options);
/**
* Change call barring facility password.
*
* @param options
* An object containing information about pin and newPin, and,
* this object must have both "pin" and "newPin" attributes
* to change the call barring facility password.
* @see MozCallBarringOptions for the detail of options.
*
* Example:
*
* changeCallBarringPassword({pin: "...",
* newPin: "..."});
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest changeCallBarringPassword(optional MozCallBarringOptions options);
/**
* Configures call waiting options.
*
* @param enabled
* Boolean indicates the desired call waiting status.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setCallWaitingOption(boolean enabled);
/**
* Queries current call waiting options.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be a boolean indicating the call waiting status.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getCallWaitingOption();
/**
* Enables or disables the presentation of the calling line identity (CLI) to
* the called party when originating a call.
*
* @param mode
* It shall be one of the MozMobileConnection.CLIR_* values.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setCallingLineIdRestriction(unsigned short mode);
/**
* Queries current CLIR status.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object containing containing CLIR 'n' and 'm' parameter.
* @see MozClirStatus for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest getCallingLineIdRestriction();
/**
* Exit emergency callback mode.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'IllegalSIMorME', or 'GenericFailure'.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest exitEmergencyCbMode();
/**
* Set radio enabled/disabled.
*
* @param enabled
* True to enable the radio.
*
* @return a DOMRequest
*
* If successful, the request's onsuccess will be called.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'InvalidStateError', 'RadioNotAvailable',
* 'IllegalSIMorME', or 'GenericFailure'.
*
* Note: Request is not available when radioState is null, 'enabling', or
* 'disabling'. Calling the function in above conditions will receive
* 'InvalidStateError' error.
*/
[Throws, CheckPermissions="mobileconnection"]
DOMRequest setRadioEnabled(boolean enabled);
/**
* The 'voicechange' event is notified whenever the voice connection object
* changes.
*/
attribute EventHandler onvoicechange;
/**
* The 'datachange' event is notified whenever the data connection object
* changes values.
*/
attribute EventHandler ondatachange;
/**
* The 'dataerror' event is notified whenever the data connection object
* receives an error from the RIL.
*/
attribute EventHandler ondataerror;
/**
* The 'oncfstatechange' event is notified whenever the call forwarding
* state changes.
*/
attribute EventHandler oncfstatechange;
/**
* The 'emergencycbmodechange' event is notified whenever the emergency
* callback mode changes.
*/
attribute EventHandler onemergencycbmodechange;
/**
* The 'onotastatuschange' event is notified whenever the ota provision status
* changes.
*/
attribute EventHandler onotastatuschange;
/**
* The 'oniccchange' event is notified whenever the iccid value
* changes.
*/
attribute EventHandler oniccchange;
/**
* The 'onradiostatechange' event is notified whenever the radio state
* changes.
*/
attribute EventHandler onradiostatechange;
/**
* The 'onclirmodechange' event is notified whenever the mode of the calling
* line id restriction (CLIR) changes.
*/
attribute EventHandler onclirmodechange;
};
dictionary MozCallForwardingOptions
{
/**
* Call forwarding rule status.
*
* It will be either not active (false), or active (true).
*
* Note: Unused for setting call forwarding options. It reports
* the status of the rule when getting how the rule is
* configured.
*
* @see 3GPP TS 27.007 7.11 "status".
*/
boolean? active;
/**
* Indicates what to do with the rule. It shall be one of the
* MozMobileConnection.CALL_FORWARD_ACTION_* values.
*/
unsigned short? action;
/**
* Indicates the reason the call is being forwarded. It shall be one of the
* MozMobileConnection.CALL_FORWARD_REASON_* values.
*/
unsigned short? reason;
/**
* Phone number of forwarding address.
*/
DOMString? number;
/**
* When "no reply" is enabled or queried, this gives the time in
* seconds to wait before call is forwarded.
*/
unsigned short? timeSeconds;
/**
* Service for which the call forward is set up. It should be one of the
* MozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
unsigned short? serviceClass;
};
dictionary MozCallBarringOptions
{
/**
* Indicates the program the call is being barred. It shall be one of the
* MozMobileConnection.CALL_BARRING_PROGRAM_* values.
*/
unsigned short? program;
/**
* Enable or disable the call barring program.
*/
boolean? enabled;
/**
* Barring password. Use "" if no password specified.
*/
DOMString? password;
/**
* Service for which the call barring is set up. It shall be one of the
* MozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
unsigned short? serviceClass;
/**
* Old call barring password.
*
* Note: Only used for changeCallBarringPassword().
*/
// TODO: Combine this with |password| and rename |newPin| to |newPassword|.
// But it needs to modify the gaia side as well, so we could consider
// doing this in bug 987541.
DOMString? pin;
/**
* New call barring password.
*
* Note: Only used for changeCallBarringPassword().
*/
DOMString? newPin;
};
dictionary MozMMIResult
{
/**
* Indicate whether the result is successful or not.
*/
boolean success = true;
/**
* String key that identifies the service associated with the MMI code
* request. The UI is supposed to handle the localization of the strings
* associated with this string key.
*/
DOMString serviceCode = "";
/**
* String key containing the status message of the associated MMI request or
* the error message when the request fails.
* The UI is supposed to handle the localization of the strings associated
* with this string key.
*/
DOMString statusMessage = "";
/**
* Some MMI requests like call forwarding or PIN/PIN2/PUK/PUK2 related
* requests provide extra information along with the status message, this
* information can be a number, an array of string keys or an array of
* MozCallForwardingOptions.
*
* And it should be
* (unsigned short or sequence<DOMString> or sequence<MozCallForwardingOptions>)
* But we cannot yet use sequences as union member types (please see bug 767924)
* ,so we use object here.
*/
(unsigned short or object) additionalInformation;
};
dictionary MozClirStatus
{
/**
* CLIR parameter 'n': parameter sets the adjustment for outgoing calls.
*
* It shall be one of the MozMobileConnection.CLIR_* values.
*/
unsigned short n;
/**
* CLIR parameter 'm': parameter shows the subscriber CLIR service status in
* the network.
* (0) CLIR not provisioned.
* (1) CLIR provisioned in permanent mode.
* (2) unknown (e.g. no network, etc.).
* (3) CLIR temporary mode presentation restricted.
*
* @see 3GPP TS 27.007 7.7 defined values.
*/
unsigned short m;
};