Bug 898445 - Part 1-4: Move MozMobileConnection to webidl. r=hsinyi,smaug

This commit is contained in:
Edgar Chen 2014-04-24 18:11:17 +08:00
parent 9a8f4cb984
commit a5b116f301
7 changed files with 644 additions and 579 deletions

View File

@ -5,7 +5,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
XPIDL_SOURCES += [
'nsIDOMMobileConnection.idl',
'nsIMobileCellInfo.idl',
'nsIMobileConnectionInfo.idl',
'nsIMobileConnectionProvider.idl',

View File

@ -1,548 +0,0 @@
/* 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/. */
#include "nsIDOMEventTarget.idl"
interface nsIDOMEventListener;
interface nsIDOMDOMRequest;
interface nsIDOMMozMobileConnectionInfo;
interface nsIDOMMozMobileNetworkInfo;
interface nsIDOMMozMobileCellInfo;
interface nsIDOMMozMobileCFInfo;
interface nsIVariant;
[scriptable, builtinclass, uuid(e891c732-216b-40b2-bda5-5a9d62e08779)]
interface nsIDOMMozMobileConnection : nsIDOMEventTarget
{
const long ICC_SERVICE_CLASS_VOICE = (1 << 0);
const long ICC_SERVICE_CLASS_DATA = (1 << 1);
const long ICC_SERVICE_CLASS_FAX = (1 << 2);
const long ICC_SERVICE_CLASS_SMS = (1 << 3);
const long ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4);
const long ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
const long ICC_SERVICE_CLASS_PACKET = (1 << 6);
const long ICC_SERVICE_CLASS_PAD = (1 << 7);
const long ICC_SERVICE_CLASS_MAX = (1 << 7);
/**
* Call barring program.
*
* (0) all outgoing.
* (1) outgoing international.
* (2) outgoing international except to home country.
* (3) all incoming.
* (4) incoming when roaming outside the home country.
*/
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
*
* (0) Uses subscription default value.
* (1) Restricts CLI presentation.
* (2) Allows CLI presentation.
*/
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.
*/
readonly attribute DOMString lastKnownNetwork;
readonly attribute DOMString lastKnownHomeNetwork;
/**
* Information about the voice connection.
*/
readonly attribute nsIDOMMozMobileConnectionInfo voice;
/**
* Information about the data connection.
*/
readonly attribute nsIDOMMozMobileConnectionInfo data;
/**
* Integrated Circuit Card Identifier of the SIM this
* mobile connection corresponds to.
*/
readonly attribute DOMString iccId;
/**
* The selection mode of the voice and data networks.
*
* Possible values: null (unknown), 'automatic', 'manual'
*/
readonly attribute DOMString networkSelectionMode;
/**
* The current radio state.
*
* Possible values: null (unknown), 'enabling', 'enabled', 'disabling',
* 'disabled'
*/
readonly attribute DOMString radioState;
/**
* Array of network types that are supported by this radio.
*
* Possible values: 'gsm', 'wcdma', 'cdma', 'evdo', 'lte'
*/
readonly attribute nsIVariant supportedNetworkTypes;
/**
* Search for available networks.
*
* If successful, the request's onsuccess will be called, and the request's
* result will be an array of nsIDOMMozMobileNetworkInfo.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* or 'GenericFailure'.
*/
nsIDOMDOMRequest getNetworks();
/**
* Manually selects the passed in network, overriding the radio's current
* selection.
*
* 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'
*/
nsIDOMDOMRequest selectNetwork(in nsIDOMMozMobileNetworkInfo network);
/**
* Tell the radio to automatically select a network.
*
* 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'
*/
nsIDOMDOMRequest selectNetworkAutomatically();
/**
* Set preferred network type
*
* @param type
* DOMString indicates the desired preferred network type.
* Possible values: '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'.
*
* 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' or 'GenericFailure'
*
* TODO: param "type" should be a WebIDL enum when this interface is converted
* to WebIDL
*/
nsIDOMDOMRequest setPreferredNetworkType(in DOMString type);
/**
* Query current preferred network type
*
* 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',
* or 'GenericFailure'
*/
nsIDOMDOMRequest getPreferredNetworkType();
/**
* Set roaming preference
*
* @param mode
* DOMString indicates the desired roaming preference.
* Possible values: 'home', 'affiliated', or 'any'.
*
* 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', 'InvalidParameter', or 'GenericFailure'
*
* TODO: param "mode" should be a WebIDL enum when this interface is converted
* to WebIDL
*/
nsIDOMDOMRequest setRoamingPreference(in DOMString mode);
/**
* Query current roaming preference
*
* 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'
*/
nsIDOMDOMRequest 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.
*
* 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', 'InvalidParameter', or 'GenericFailure'
*/
nsIDOMDOMRequest setVoicePrivacyMode(in bool enabled);
/**
* Query current voice privacy mode.
*
* 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'
*/
nsIDOMDOMRequest getVoicePrivacyMode();
/**
* Send a MMI message.
*
* @param mmi
* DOMString containing an MMI string that can be associated to a
* USSD request or other RIL functionality.
*
* @return a nsIDOMDOMRequest
* The request's result will be an object containing information
* about the operation.
*
* In case that the MMI code requires sending an USSD request, the DOMrequest
* 'success' event means that the RIL has successfully processed and sent the
* USSD request to the network. The network reply will be reported via
* 'onussdreceived' event. If the MMI code is not associated to a USSD but to
* other RIL request its result, if one is needed, will be notified via the
* returned DOMRequest 'success' or 'error' event.
*/
nsIDOMDOMRequest sendMMI(in DOMString mmi);
/**
* Cancel the current MMI request if one exists.
*/
nsIDOMDOMRequest cancelMMI();
/**
* Configures call forward options.
*
* @param CFInfo
* An object containing the call forward rule to set.
*
* 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', 'InvalidParameter', or 'GenericFailure'
*/
nsIDOMDOMRequest setCallForwardingOption(in nsIDOMMozMobileCFInfo CFInfo);
/**
* Queries current call forward options.
*
* @param reason
* Indicates the reason the call is being forwarded. It will be either
* unconditional (0), mobile busy (1), no reply (2), not reachable (3),
* all call forwarding (4), or all conditional call forwarding (5).
*
* If successful, the request's onsuccess will be called, and the request's
* result will be an array of nsIDOMMozMobileCFInfo.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallForwardingOption(in unsigned short reason);
/**
* Configures call barring option.
*
* @param option
* An object containing the call barring rule to set.
* @see MozCallBarringOption for the detail of info.
*
* 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', 'InvalidParameter', or 'GenericFailure'
*/
nsIDOMDOMRequest setCallBarringOption(in jsval option);
/**
* Queries current call barring status.
*
* @param info
* An object containing the call barring rule to query. No need to
* specify 'enabled' property.
* @see MozCallBarringOption for the detail of info.
*
* If successful, the request's onsuccess will be called, and the request's
* result will be an object of MozCallBarringOption with correct 'enabled'
* property indicating the status of this rule.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* 'InvalidParameter', or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallBarringOption(in jsval option);
/**
* Change call barring facility password.
*
* @param info
* 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.
*
* Example:
*
* changeCallBarringPassword({pin: "...",
* newPin: "..."});
*/
nsIDOMDOMRequest changeCallBarringPassword(in jsval info);
/**
* Configures call waiting options.
*
* @param enabled
* Value containing the desired call waiting status.
*
* 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'
*/
nsIDOMDOMRequest setCallWaitingOption(in bool enabled);
/**
* Queries current call waiting options.
*
* 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',
* or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallWaitingOption();
/**
* Enables or disables the presentation of the calling line identity (CLI) to
* the called party when originating a call.
*
* @param clirMode
* Is one of the CLIR_* constants.
*
* 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',
*/
nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned short clirMode);
/**
* Queries current CLIR status.
*
* If successful, the request's onsuccess will be called, and the request's
* result will be a DOMCLIRStatus dictionary containing CLIR 'n' and 'm'
* parameter.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be either 'RadioNotAvailable', 'RequestNotSupported',
* or 'GenericFailure'.
*/
nsIDOMDOMRequest getCallingLineIdRestriction();
/**
* Exit emergency callback mode.
*
* 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 'RequestNotSupported' or 'GenericFailure'.
*/
nsIDOMDOMRequest exitEmergencyCbMode();
/**
* Set radio enabled/disabled.
*
* @param enabled
* True to enable the radio.
*
* 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', or
* 'GenericFailure'.
*
* Note: Request is not available when radioState is null, 'enabling', or
* 'disabling'. Calling the function in above conditions will receive
* 'InvalidStateError' error.
*/
nsIDOMDOMRequest setRadioEnabled(in boolean enabled);
/**
* The 'voicechange' event is notified whenever the voice connection object
* changes.
*/
[implicit_jscontext] attribute jsval onvoicechange;
/**
* The 'datachange' event is notified whenever the data connection object
* changes values.
*/
[implicit_jscontext] attribute jsval ondatachange;
/**
* The 'ussdreceived' event is notified whenever a new USSD message is
* received.
*/
[implicit_jscontext] attribute jsval onussdreceived;
/**
* The 'dataerror' event is notified whenever the data connection object
* receives an error from the RIL
*/
[implicit_jscontext] attribute jsval ondataerror;
/**
* The 'oncfstatechange' event is notified whenever the call forwarding
* state changes.
*/
[implicit_jscontext] attribute jsval oncfstatechange;
/**
* The 'emergencycbmodechange' event is notified whenever the emergency
* callback mode changes.
*/
[implicit_jscontext] attribute jsval onemergencycbmodechange;
/**
* The 'onotastatuschange' event is notified whenever the ota provision status
* changes.
*/
[implicit_jscontext] attribute jsval onotastatuschange;
/**
* The 'oniccchange' event is notified whenever the iccid value
* changes.
*/
[implicit_jscontext] attribute jsval oniccchange;
/**
* The 'onradiostatechange' event is notified whenever the radio state
* changes.
*/
[implicit_jscontext] attribute jsval onradiostatechange;
/**
* The 'onclirmodechange' event is notified whenever the mode of the calling
* line id restriction (CLIR) changes.
*/
[implicit_jscontext] attribute jsval onclirmodechange;
};
[scriptable, uuid(d1b35ad8-99aa-47cc-ab49-2e72b00e39df)]
interface nsIDOMMozMobileCFInfo : nsISupports
{
/**
* 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".
*/
readonly attribute bool active;
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;
/**
* Indicates what to do with the rule.
*
* One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
* enable (1), query status (2), registration (3), or erasure (4).
*
* @see 3GPP TS 27.007 7.11 "mode".
*/
readonly attribute unsigned short action;
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;
/**
* Indicates the reason the call is being forwarded.
*
* One of the CALL_FORWARD_REASON_* constants. It will be either
* unconditional (0), mobile busy (1), no reply (2), not reachable (3),
* all call forwarding (4), or all conditional call forwarding (5).
*
* @see 3GPP TS 27.007 7.11 "reason".
*/
readonly attribute unsigned short reason;
/**
* Phone number of forwarding address.
*/
readonly attribute DOMString number;
/**
* When "no reply" is enabled or queried, this gives the time in
* seconds to wait before call is forwarded.
*/
readonly attribute unsigned short timeSeconds;
/**
* Service for which the call forward is set up. It should be one of the
* nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
readonly attribute unsigned short serviceClass;
};

View File

@ -19,7 +19,7 @@ interface CFStateChangeEvent : Event
* One of the CALL_FORWARD_ACTION_* constants. It will be either disable (0),
* enable (1), query status (2), registration (3), or erasure (4).
*
* @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_ACTION_* values.
* @see 3GPP MozMobileConnection.CALL_FORWARD_ACTION_* values.
* @see 3GPP TS 27.007 7.11 "mode".
*/
readonly attribute unsigned short action;
@ -31,7 +31,7 @@ interface CFStateChangeEvent : Event
* unconditional (0), mobile busy (1), no reply (2), not reachable (3),
* all call forwarding (4), or all conditional call forwarding (5).
*
* @see 3GPP nsIDOMMozMobileCFInfo.CALL_FORWARD_REASON_* values.
* @see 3GPP MozMobileConnection.CALL_FORWARD_REASON_* values.
* @see 3GPP TS 27.007 7.11 "reason".
*/
readonly attribute unsigned short reason;
@ -49,7 +49,7 @@ interface CFStateChangeEvent : Event
/**
* Service for which the call forward is set up. It should be one of the
* nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
* MozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
readonly attribute unsigned short serviceClass;
};

View File

@ -11,7 +11,7 @@ interface MozClirModeEvent : Event
/**
* Indicates the mode of the calling line id restriction (CLIR).
*
* @see nsIDOMMozMobileConnection.CLIR_* values.
* @see MozMobileConnection.CLIR_* values.
*/
readonly attribute unsigned long mode;
};

View File

@ -2,37 +2,656 @@
* 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"};
dictionary MozCallBarringOption
[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.
*/
readonly attribute DOMString lastKnownNetwork;
readonly attribute DOMString lastKnownHomeNetwork;
/**
* Information about the voice connection.
*/
readonly attribute MozMobileConnectionInfo voice;
/**
* Information about the data connection.
*/
readonly attribute MozMobileConnectionInfo data;
/**
* Integrated Circuit Card Identifier of the SIM this mobile connection
* corresponds to.
*/
readonly attribute DOMString? iccId;
/**
* The selection mode of the voice and data networks.
*/
readonly attribute MobileNetworkSelectionMode? networkSelectionMode;
/**
* The current radio state.
*/
readonly attribute MobileRadioState? radioState;
/**
* Array of network types that are supported by this radio.
*/
[Cached, Pure]
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]
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]
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]
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]
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]
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]
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]
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]
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]
DOMRequest getVoicePrivacyMode();
/**
* Send a MMI message.
*
* @param mmi
* DOMString containing an MMI string that can be associated to a
* USSD request or other RIL functionality.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object containing information about the operation.
* @see MozMMIResult for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be a DOMMMIError.
* @see DOMMMIError for the detail of error.
*
* Note: In case that the MMI code requires sending an USSD request, the
* DOMrequest 'success' event means that the RIL has successfully processed
* and sent the USSD request to the network. The network reply will be
* reported via 'onussdreceived' event. If the MMI code is not associated to
* a USSD but to other RIL request its result, if one is needed, will be
* notified via the returned DOMRequest 'success' or 'error' event.
*/
[Throws]
DOMRequest sendMMI(DOMString mmi);
/**
* Cancel the current MMI request if one exists.
*
* @return a DOMRequest.
*
* If successful, the request's onsuccess will be called. And the request's
* result will be an object containing information about the operation.
* @see MozMMIResult for the detail of result.
*
* Otherwise, the request's onerror will be called, and the request's error
* will be a DOMMMIError.
* @see DOMMMIError for the detail of error.
*/
[Throws]
DOMRequest cancelMMI();
/**
* 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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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 'ussdreceived' event is notified whenever a new USSD message is
* received.
*/
attribute EventHandler onussdreceived;
/**
* 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
{
/**
* Indicates the program the call is being barred.
* Call forwarding rule status.
*
* It shall be one of the nsIDOMMozMobileConnection.CALL_BARRING_PROGRAM_*
* values.
* 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".
*/
unsigned short program;
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;
boolean? enabled;
/**
* Barring password. Use "" if no password specified.
*/
DOMString password;
DOMString? password;
/**
* Service for which the call barring is set up.
*
* It shall be one of the nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_*
* values.
* Service for which the call barring is set up. It shall be one of the
* MozMobileConnection.ICC_SERVICE_CLASS_* values.
*/
unsigned short serviceClass;
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 DOMMMIResult
dictionary MozMMIResult
{
/**
* String key that identifies the service associated with the MMI code
@ -56,27 +675,24 @@ dictionary DOMMMIResult
any additionalInformation;
};
dictionary DOMCLIRStatus
dictionary MozClirStatus
{
/**
* CLIR parameter 'n': parameter sets the adjustment for outgoing calls.
*
* 0 Presentation indicator is used according to the subscription of the
* CLIR service (uses subscription default value).
* 1 CLIR invocation (restricts CLI presentation).
* 2 CLIR suppression (allows CLI presentation).
* 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.
* (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
* @see 3GPP TS 27.007 7.7 defined values.
*/
unsigned short m;
};

View File

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface MozMobileConnection;
interface MozMobileConnectionArray {
getter MozMobileConnection? item(unsigned long index);
readonly attribute unsigned long length;

View File

@ -245,7 +245,6 @@ WEBIDL_FILES = [
'MouseScrollEvent.webidl',
'MozActivity.webidl',
'MozMmsMessage.webidl',
'MozMobileConnection.webidl',
'MozNamedAttrMap.webidl',
'MozPowerManager.webidl',
'MozTimeManager.webidl',
@ -552,6 +551,7 @@ if CONFIG['MOZ_B2G_RIL']:
'MozIcc.webidl',
'MozIccManager.webidl',
'MozMobileCellInfo.webidl',
'MozMobileConnection.webidl',
'MozMobileConnectionArray.webidl',
'MozMobileConnectionInfo.webidl',
'MozMobileNetworkInfo.webidl',