diff --git a/dom/mobileconnection/interfaces/moz.build b/dom/mobileconnection/interfaces/moz.build index dacc8fafe81..960e882f123 100644 --- a/dom/mobileconnection/interfaces/moz.build +++ b/dom/mobileconnection/interfaces/moz.build @@ -8,7 +8,7 @@ XPIDL_SOURCES += [ 'nsICellInfo.idl', 'nsIMobileCellInfo.idl', 'nsIMobileConnectionInfo.idl', - 'nsIMobileConnectionProvider.idl', + 'nsIMobileConnectionService.idl', 'nsIMobileNetworkInfo.idl', 'nsINeighboringCellInfo.idl', ] diff --git a/dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl b/dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl deleted file mode 100644 index fcac0029200..00000000000 --- a/dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl +++ /dev/null @@ -1,749 +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 "nsISupports.idl" - -interface nsIDOMDOMRequest; -interface nsIDOMWindow; -interface nsIMobileConnectionInfo; -interface nsIMobileNetworkInfo; -interface nsIVariant; - -[scriptable, uuid(c6d98e6a-d96f-45fe-aa86-01453a6daf9e)] -interface nsIMobileConnectionListener : nsISupports -{ - /** - * Notify when voice info is changed. - */ - void notifyVoiceChanged(); - - /** - * Notify when data info is changed. - */ - void notifyDataChanged(); - - /** - * Notify when ussd is received. - * - * @param message - * The ussd request in string format. - * @param sessionEnded - * Indicates whether the session is ended. - */ - void notifyUssdReceived(in DOMString message, - in boolean sessionEnded); - - /** - * Notify when data call is failed to establish. - * - * @param message - * Error message from RIL. - */ - void notifyDataError(in DOMString message); - - /** - * Notify when call forwarding state is changed. - * - * @param success - * Indicates whether the set call forwarding request is success. - * @param action - * One of the nsIMobileConnectionProvider.CALL_FORWARD_ACTION_* values. - * @param reason - * One of the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values. - * @param number - * Phone number of forwarding address. - * @param timeSeconds - * The time in seconds should wait before call is forwarded. - * @param serviceClass - * One of the nsIMobileConnectionProvider.ICC_SERVICE_CLASS_* values. - */ - void notifyCFStateChange(in boolean success, - in unsigned short action, - in unsigned short reason, - in DOMString number, - in unsigned short timeSeconds, - in unsigned short serviceClass); - - /** - * Notify when emergency callback mode is changed. - * - * @param active - * Indicates whether the emergency callback mode is activated. - * @param timeoutMs - * The timeout in millisecond for emergency callback mode. - */ - void notifyEmergencyCbModeChanged(in boolean active, - in unsigned long timeoutMs); - - /** - * Notify when ota status is changed. - * - * @param status - * Ota status. Possible values: 'spl_unlocked', 'spc_retries_exceeded', - * 'a_key_exchanged', 'ssd_updated', 'nam_downloaded', 'mdn_downloaded', - * 'imsi_downloaded', 'prl_downloaded', 'committed', 'otapa_started', - * 'otapa_stopped', 'otapa_aborted'. - */ - void notifyOtaStatusChanged(in DOMString status); - - /** - * Notify when icc id is changed. - */ - void notifyIccChanged(); - - /** - * Notify when radio state is changed. - */ - void notifyRadioStateChanged(); - - /** - * Notify when clir mode is changed. - * - * @param mode - * One of the nsIMobileConnectionProvider.CLIR_* values. - */ - void notifyClirModeChanged(in unsigned long mode); -}; - -/** - * XPCOM component (in the content process) that provides the mobile - * network information. - */ -[scriptable, uuid(2a3af80f-9f8e-447d-becd-034f95e4cd4d)] -interface nsIMobileConnectionProvider : nsISupports -{ - 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 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; - - /** - * Called when a content process registers receiving unsolicited messages from - * RadioInterfaceLayer in the chrome process. Only a content process that has - * the 'mobileconnection' permission is allowed to register. - */ - void registerMobileConnectionMsg(in unsigned long clientId, - in nsIMobileConnectionListener listener); - void unregisterMobileConnectionMsg(in unsigned long clientId, - in nsIMobileConnectionListener listener); - - /** - * These two fields require the 'mobilenetwork' permission. - */ - DOMString getLastKnownNetwork(in unsigned long clientId); - DOMString getLastKnownHomeNetwork(in unsigned long clientId); - - /** - * All fields below require the 'mobileconnection' permission. - */ - - /** - * Get the connection information about the voice. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return a nsIMobileConnectionInfo - */ - nsIMobileConnectionInfo getVoiceConnectionInfo(in unsigned long clientId); - - /** - * Get the connection information about the data. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return a nsIMobileConnectionInfo - */ - nsIMobileConnectionInfo getDataConnectionInfo(in unsigned long clientId); - - /** - * Get the integrated circuit card identifier of the SIM. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return a DOMString indicates the iccId - */ - DOMString getIccId(in unsigned long clientId); - - /** - * Get the selection mode of the voice and data networks. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return a DOMString - * Possible values: 'automatic', 'manual', null (unknown). - */ - DOMString getNetworkSelectionMode(in unsigned long clientId); - - /** - * Get the current radio state. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return a DOMString - * Possible values: 'enabling', 'enabled', 'disabling', 'disabled', - * null (unknown). - */ - DOMString getRadioState(in unsigned long clientId); - - /** - * Get the network types that are supported by this radio. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * - * @return an array of DOMString - * Possible values: 'gsm', 'wcdma', 'cdma', 'evdo', 'lte'. - */ - nsIVariant getSupportedNetworkTypes(in unsigned long clientId); - - /** - * Search for available networks. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * If successful, the request's onsuccess will be called. And the request's - * result will be an array of nsIMobileNetworkInfo. - * - * Otherwise, the request's onerror will be called, and the request's error - * will be either 'RadioNotAvailable', 'RequestNotSupported', - * 'IllegalSIMorME', or 'GenericFailure'. - */ - nsIDOMDOMRequest getNetworks(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Manually selects the passed in network, overriding the radio's current - * selection. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param network - * The manually selecting network. - * - * @return a nsIDOMDOMRequest - * - * 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 selectNetwork(in unsigned long clientId, - in nsIDOMWindow window, - in nsIMobileNetworkInfo network); - - /** - * Tell the radio to automatically select a network. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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 selectNetworkAutomatically(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Set preferred network type. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @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'. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest setPreferredNetworkType(in unsigned long clientId, - in nsIDOMWindow window, - in DOMString type); - - /** - * Query current preferred network type. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest getPreferredNetworkType(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Set roaming preference. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param mode - * DOMString indicates the desired roaming preference. - * Possible values: 'home', 'affiliated', or 'any'. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest setRoamingPreference(in unsigned long clientId, - in nsIDOMWindow window, - in DOMString mode); - - /** - * Query current roaming preference. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Set voice privacy preference. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @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 nsIDOMDOMRequest - * - * 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 setVoicePrivacyMode(in unsigned long clientId, - in nsIDOMWindow window, - in bool enabled); - - /** - * Query current voice privacy mode. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Send a MMI message. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param mmi - * DOMString containing an MMI string that can be associated to a - * USSD request or other RIL functionality. - * - * @return a nsIDOMDOMRequest - * - * 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. - */ - nsIDOMDOMRequest sendMMI(in unsigned long clientId, - in nsIDOMWindow window, - in DOMString mmi); - - /** - * Cancel the current MMI request if one exists. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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. - */ - nsIDOMDOMRequest cancelMMI(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Queries current call forwarding options. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param reason - * Indicates the reason the call is being forwarded. It shall be one of - * the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest getCallForwarding(in unsigned long clientId, - in nsIDOMWindow window, - in unsigned short reason); - - /** - * Configures call forwarding options. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param options - * An object containing the call forward rule to set. - * @see MozCallForwardingOptions for the detail of options. - * - * @return a nsIDOMDOMRequest - * - * 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' - */ - nsIDOMDOMRequest setCallForwarding(in unsigned long clientId, - in nsIDOMWindow window, - in jsval options); - - /** - * Queries current call barring status. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @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 nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest getCallBarring(in unsigned long clientId, - in nsIDOMWindow window, - in jsval options); - - /** - * Configures call barring option. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param options - * An object containing the call barring rule to set. - * @see MozCallBarringOptions for the detail of options. - * - * @return a nsIDOMDOMRequest - * - * 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' - */ - nsIDOMDOMRequest setCallBarring(in unsigned long clientId, - in nsIDOMWindow window, - in jsval options); - - /** - * Change call barring facility password. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @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. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest changeCallBarringPassword(in unsigned long clientId, - in nsIDOMWindow window, - in jsval options); - - /** - * Configures call waiting options. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param enabled - * Boolean indicates the desired call waiting status. - * - * @return a nsIDOMDOMRequest - * - * 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 setCallWaiting(in unsigned long clientId, - in nsIDOMWindow window, - in bool enabled); - - /** - * Queries current call waiting options. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest getCallWaiting(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Enables or disables the presentation of the calling line identity (CLI) to - * the called party when originating a call. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param clirMode - * One of the nsIMobileConnectionProvider.CLIR_* values. - * - * @return a nsIDOMDOMRequest - * - * 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'. - */ - nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned long clientId, - in nsIDOMWindow window, - in unsigned short clirMode); - - /** - * Queries current CLIR status. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * If successful, the request's onsuccess will be called. And the request's - * result will be a an object 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'. - */ - nsIDOMDOMRequest getCallingLineIdRestriction(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Exit emergency callback mode. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * - * @return a nsIDOMDOMRequest - * - * 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 exitEmergencyCbMode(in unsigned long clientId, - in nsIDOMWindow window); - - /** - * Set radio enabled/disabled. - * - * @param clientId - * Indicate the RIL client, 0 ~ (number of client - 1). - * @param window - * Current window. - * @param enabled - * Boolean indicates the desired radio power. True to enable the radio. - * - * @return a nsIDOMDOMRequest - * - * 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. - */ - nsIDOMDOMRequest setRadioEnabled(in unsigned long clientId, - in nsIDOMWindow window, - in bool enabled); -}; diff --git a/dom/mobileconnection/interfaces/nsIMobileConnectionService.idl b/dom/mobileconnection/interfaces/nsIMobileConnectionService.idl new file mode 100644 index 00000000000..b5cdd7c99cb --- /dev/null +++ b/dom/mobileconnection/interfaces/nsIMobileConnectionService.idl @@ -0,0 +1,754 @@ +/* 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 "nsISupports.idl" + +interface nsIMobileConnectionInfo; +interface nsIMobileNetworkInfo; +interface nsIVariant; + +[scriptable, uuid(bc0d4d76-fd3a-4593-818f-cb6ff87fbb55)] +interface nsIMobileConnectionListener : nsISupports +{ + /** + * Notify when voice info is changed. + */ + void notifyVoiceChanged(); + + /** + * Notify when data info is changed. + */ + void notifyDataChanged(); + + /** + * Notify when ussd is received. + * + * @param message + * The ussd request in string format. + * @param sessionEnded + * Indicates whether the session is ended. + */ + void notifyUssdReceived(in DOMString message, + in boolean sessionEnded); + + /** + * Notify when data call is failed to establish. + * + * @param message + * Error message from RIL. + */ + void notifyDataError(in DOMString message); + + /** + * Notify when call forwarding state is changed. + * + * @param success + * Indicates whether the set call forwarding request is success. + * @param action + * One of the nsIMobileConnectionService.CALL_FORWARD_ACTION_* values. + * @param reason + * One of the nsIMobileConnectionService.CALL_FORWARD_REASON_* values. + * @param number + * Phone number of forwarding address. + * @param timeSeconds + * The time in seconds should wait before call is forwarded. + * @param serviceClass + * One of the nsIMobileConnectionService.ICC_SERVICE_CLASS_* values. + */ + void notifyCFStateChanged(in boolean success, + in unsigned short action, + in unsigned short reason, + in DOMString number, + in unsigned short timeSeconds, + in unsigned short serviceClass); + + /** + * Notify when emergency callback mode is changed. + * + * @param active + * Indicates whether the emergency callback mode is activated. + * @param timeoutMs + * The timeout in millisecond for emergency callback mode. + */ + void notifyEmergencyCbModeChanged(in boolean active, + in unsigned long timeoutMs); + + /** + * Notify when ota status is changed. + * + * @param status + * Ota status. Possible values: 'spl_unlocked', 'spc_retries_exceeded', + * 'a_key_exchanged', 'ssd_updated', 'nam_downloaded', 'mdn_downloaded', + * 'imsi_downloaded', 'prl_downloaded', 'committed', 'otapa_started', + * 'otapa_stopped', 'otapa_aborted'. + */ + void notifyOtaStatusChanged(in DOMString status); + + /** + * Notify when icc id is changed. + */ + void notifyIccChanged(); + + /** + * Notify when radio state is changed. + */ + void notifyRadioStateChanged(); + + /** + * Notify when clir mode is changed. + * + * @param mode + * One of the nsIMobileConnectionService.CLIR_* values. + */ + void notifyClirModeChanged(in unsigned long mode); + + /** + * Notify when last known network is changed. + */ + void notifyLastKnownNetworkChanged(); + + /** + * Notify when last known home network is changed. + */ + void notifyLastKnownHomeNetworkChanged(); + + /** + * Notify when network selection mode is changed. + */ + void notifyNetworkSelectionModeChanged(); +}; + +[scriptable, builtinclass, uuid(eea91fcf-6bde-43be-aa01-d6cdfaad26e1)] +interface nsIMobileConnectionCallback : nsISupports +{ + /** + * notify*Success*() will be called, when request is succeed. + */ + void notifySuccess(); + + void notifySuccessWithString(in DOMString result); + + void notifySuccessWithBoolean(in boolean result); + + void notifyGetNetworksSuccess(in uint32_t count, + [array, size_is(count)] in nsIMobileNetworkInfo networks); + + void notifySendCancelMmiSuccess(in jsval result /* MozMMIResult */); + + void notifyGetCallForwardingSuccess(in jsval results /* Array of MozCallForwardingOptions */); + + void notifyGetCallBarringSuccess(in unsigned short program, + in boolean enabled, + in unsigned short serviceClass); + + void notifyGetClirStatusSuccess(in unsigned short n, in unsigned short m); + + /** + * notifyError() will be called, when request is failed. + */ + [optional_argc] + void notifyError(in DOMString name, + [optional] in DOMString message, + [optional] in DOMString serviceCode, + [optional] in unsigned short additionalInformation); +}; + +%{C++ +#define NS_MOBILE_CONNECTION_SERVICE_CID \ + { 0xc6f229d4, 0x16e2, 0x4600, \ + { 0x87, 0x2a, 0x3d, 0x3d, 0xc5, 0xb8, 0x55, 0x41 } } +#define NS_MOBILE_CONNECTION_SERVICE_CONTRACTID \ + "@mozilla.org/mobileconnection/mobileconnectionservice;1" +%} + +/** + * XPCOM component (in the content process) that provides the mobile + * network information. + */ +[scriptable, uuid(b50ad32d-f70e-4729-a947-e8cfdb6ba81f)] +interface nsIMobileConnectionService : nsISupports +{ + 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 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; + + /** + * Called when a content process registers receiving unsolicited messages from + * RadioInterfaceLayer in the chrome process. Only a content process that has + * the 'mobileconnection' permission is allowed to register. + */ + void registerListener(in unsigned long clientId, + in nsIMobileConnectionListener listener); + void unregisterListener(in unsigned long clientId, + in nsIMobileConnectionListener listener); + + /** + * These two fields require the 'mobilenetwork' permission. + */ + DOMString getLastKnownNetwork(in unsigned long clientId); + DOMString getLastKnownHomeNetwork(in unsigned long clientId); + + /** + * All fields below require the 'mobileconnection' permission. + */ + + /** + * Get the connection information about the voice. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return a nsIMobileConnectionInfo + */ + nsIMobileConnectionInfo getVoiceConnectionInfo(in unsigned long clientId); + + /** + * Get the connection information about the data. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return a nsIMobileConnectionInfo + */ + nsIMobileConnectionInfo getDataConnectionInfo(in unsigned long clientId); + + /** + * Get the integrated circuit card identifier of the SIM. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return a DOMString indicates the iccId + */ + DOMString getIccId(in unsigned long clientId); + + /** + * Get the selection mode of the voice and data networks. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return a DOMString + * Possible values: 'automatic', 'manual', null (unknown). + */ + DOMString getNetworkSelectionMode(in unsigned long clientId); + + /** + * Get the current radio state. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return a DOMString + * Possible values: 'enabling', 'enabled', 'disabling', 'disabled', + * null (unknown). + */ + DOMString getRadioState(in unsigned long clientId); + + /** + * Get the network types that are supported by this radio. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * + * @return an array of DOMString + * Possible values: 'gsm', 'wcdma', 'cdma', 'evdo', 'lte'. + */ + nsIVariant getSupportedNetworkTypes(in unsigned long clientId); + + /** + * Search for available networks. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifyGetNetworksSuccess() will be called. And the + * result will be an array of nsIMobileNetworkInfo. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getNetworks(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Manually selects the passed in network, overriding the radio's current + * selection. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param network + * The manually selecting network. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void selectNetwork(in unsigned long clientId, + in nsIMobileNetworkInfo network, + in nsIMobileConnectionCallback requestCallback); + + /** + * Tell the radio to automatically select a network. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void selectNetworkAutomatically(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Set preferred network type. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @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'. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void setPreferredNetworkType(in unsigned long clientId, + in DOMString type, + in nsIMobileConnectionCallback requestCallback); + + /** + * Query current preferred network type. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccessString() will be called. And the 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 notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getPreferredNetworkType(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Set roaming preference. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param mode + * DOMString indicates the desired roaming preference. + * Possible values: 'home', 'affiliated', or 'any'. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void setRoamingPreference(in unsigned long clientId, + in DOMString mode, + in nsIMobileConnectionCallback requestCallback); + + /** + * Query current roaming preference. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccessWithString() will be called. And the result + * will be a string indicating the current roaming preference. The value will + * be either 'home', 'affiliated', or 'any'. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getRoamingPreference(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Set voice privacy preference. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param enabled + * Boolean indicates the preferred voice privacy mode used in voice + * scrambling in CDMA networks. 'True' means the enhanced voice security + * is required. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void setVoicePrivacyMode(in unsigned long clientId, + in bool enabled, + in nsIMobileConnectionCallback requestCallback); + + /** + * Query current voice privacy mode. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccessWithBoolean() will be called. And the result + * will be a boolean indicating the current voice privacy mode. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getVoicePrivacyMode(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Send a MMI message. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param mmi + * DOMString containing an MMI string that can be associated to a + * USSD request or other RIL functionality. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySendCancelMmiSuccess() will be called. And the + * result will contain the information about the mmi operation. + * + * Otherwise, the notifyError() will be called. + */ + void sendMMI(in unsigned long clientId, + in DOMString mmi, + in nsIMobileConnectionCallback requestCallback); + + /** + * Cancel the current MMI request if one exists. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySendCancelMmiSuccess() will be called. And the + * result will contain the information about the mmi operation. + * + * Otherwise, the notifyError() will be called. + */ + void cancelMMI(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Queries current call forwarding options. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param reason + * Indicates the reason the call is being forwarded. It shall be one of + * the nsIMobileConnectionService.CALL_FORWARD_REASON_* values. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifyGetCallForwardingSuccess() will be called. And the + * result will be an array of MozCallForwardingOptions. + * @see MozCallForwardingOptions for the detail of result. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void getCallForwarding(in unsigned long clientId, + in unsigned short reason, + in nsIMobileConnectionCallback requestCallback); + + /** + * Configures call forwarding options. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param options + * An object containing the call forward rule to set. + * @see MozCallForwardingOptions for the detail of options. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void setCallForwarding(in unsigned long clientId, + in jsval options, + in nsIMobileConnectionCallback requestCallback); + + /** + * Queries current call barring status. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param options + * An object containing the call barring rule to query. No need to + * specify 'enabled' property. + * @see MozCallBarringOptions for the detail of options. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifyGetCallBarringSuccess() will be called. And the + * result will contain correct 'enabled' property indicating the status of + * this rule. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void getCallBarring(in unsigned long clientId, + in jsval options, + in nsIMobileConnectionCallback requestCallback); + + /** + * Configures call barring option. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param options + * An object containing the call barring rule to set. + * @see MozCallBarringOptions for the detail of options. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void setCallBarring(in unsigned long clientId, + in jsval options, + in nsIMobileConnectionCallback requestCallback); + + /** + * Change call barring facility password. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @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. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void changeCallBarringPassword(in unsigned long clientId, + in jsval options, + in nsIMobileConnectionCallback requestCallback); + + /** + * Configures call waiting options. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param enabled + * Boolean indicates the desired call waiting status. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void setCallWaiting(in unsigned long clientId, + in bool enabled, + in nsIMobileConnectionCallback requestCallback); + + /** + * Queries current call waiting options. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccessWithBoolean() will be called. And the result + * will be a boolean indicating the call waiting status. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getCallWaiting(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Enables or disables the presentation of the calling line identity (CLI) to + * the called party when originating a call. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param clirMode + * One of the nsIMobileConnectionService.CLIR_* values. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter', + * 'IllegalSIMorME', or 'GenericFailure'. + */ + void setCallingLineIdRestriction(in unsigned long clientId, + in unsigned short clirMode, + in nsIMobileConnectionCallback requestCallback); + + /** + * Queries current CLIR status. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifyGetClirStatusSuccess() will be called. And the + * result will be a an object containing CLIR 'n' and 'm' parameter. + * @see MozClirStatus for the detail of result. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void getCallingLineIdRestriction(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Exit emergency callback mode. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the error will be either + * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or + * 'GenericFailure'. + */ + void exitEmergencyCbMode(in unsigned long clientId, + in nsIMobileConnectionCallback requestCallback); + + /** + * Set radio enabled/disabled. + * + * @param clientId + * Indicate the RIL client, 0 ~ (number of client - 1). + * @param enabled + * Boolean indicates the desired radio power. True to enable the radio. + * @param requestCallback + * Called when request is finished. + * + * If successful, the notifySuccess() will be called. + * + * Otherwise, the notifyError() will be called, and the 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. + */ + void setRadioEnabled(in unsigned long clientId, + in bool enabled, + in nsIMobileConnectionCallback requestCallback); +};