Bug 843452 - Part 2-1: Rename MobileConnectionProvider to MobileConnectionService and redesign for IPDL. r=hsinyi
☠☠ backed out by de824c1ec349 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Wed, 02 Jul 2014 17:13:33 +0800
changeset 224030 52f25f1278e3c8a3db134487122712f155aca361
parent 224029 181337820a7cc992678276253c32a1691895fb88
child 224031 82f8670f5c179b3519e7d710ed1ca81b39baedd8
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsinyi
bugs843452
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 843452 - Part 2-1: Rename MobileConnectionProvider to MobileConnectionService and redesign for IPDL. r=hsinyi
dom/mobileconnection/interfaces/moz.build
dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl
dom/mobileconnection/interfaces/nsIMobileConnectionService.idl
--- a/dom/mobileconnection/interfaces/moz.build
+++ b/dom/mobileconnection/interfaces/moz.build
@@ -3,14 +3,14 @@
 # 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/.
 
 XPIDL_SOURCES += [
     'nsICellInfo.idl',
     'nsIMobileCellInfo.idl',
     'nsIMobileConnectionInfo.idl',
-    'nsIMobileConnectionProvider.idl',
+    'nsIMobileConnectionService.idl',
     'nsIMobileNetworkInfo.idl',
     'nsINeighboringCellInfo.idl',
 ]
 
 XPIDL_MODULE = 'dom_mobileconnection'
rename from dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl
rename to dom/mobileconnection/interfaces/nsIMobileConnectionService.idl
--- a/dom/mobileconnection/interfaces/nsIMobileConnectionProvider.idl
+++ b/dom/mobileconnection/interfaces/nsIMobileConnectionService.idl
@@ -1,21 +1,19 @@
 /* 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)]
+[scriptable, uuid(bc0d4d76-fd3a-4593-818f-cb6ff87fbb55)]
 interface nsIMobileConnectionListener : nsISupports
 {
   /**
    * Notify when voice info is changed.
    */
   void notifyVoiceChanged();
 
   /**
@@ -43,32 +41,32 @@ interface nsIMobileConnectionListener : 
   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.
+   *        One of the nsIMobileConnectionService.CALL_FORWARD_ACTION_* values.
    * @param reason
-   *        One of the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values.
+   *        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 nsIMobileConnectionProvider.ICC_SERVICE_CLASS_* values.
+   *        One of the nsIMobileConnectionService.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);
+  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.
@@ -96,27 +94,85 @@ interface nsIMobileConnectionListener : 
    * Notify when radio state is changed.
    */
   void notifyRadioStateChanged();
 
   /**
    * Notify when clir mode is changed.
    *
    * @param mode
-   *        One of the nsIMobileConnectionProvider.CLIR_* values.
+   *        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(2a3af80f-9f8e-447d-becd-034f95e4cd4d)]
-interface nsIMobileConnectionProvider : nsISupports
+[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);
@@ -164,20 +220,20 @@ interface nsIMobileConnectionProvider : 
   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);
+  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);
 
   /**
@@ -248,502 +304,451 @@ interface nsIMobileConnectionProvider : 
    */
   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.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called. And the request's
+   * If successful, the notifyGetNetworksSuccess() will be called. And the
    * 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getNetworks(in unsigned long clientId,
-                               in nsIDOMWindow window);
+  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 window
-   *        Current window.
    * @param network
    *        The manually selecting network.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest selectNetwork(in unsigned long clientId,
-                                 in nsIDOMWindow window,
-                                 in nsIMobileNetworkInfo network);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest selectNetworkAutomatically(in unsigned long clientId,
-                                              in nsIDOMWindow window);
+  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 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'.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest setPreferredNetworkType(in unsigned long clientId,
-                                           in nsIDOMWindow window,
-                                           in DOMString type);
+  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 window
-   *        Current window.
-   *
-   * @return a nsIDOMDOMRequest
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * 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'.
+   * 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 request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getPreferredNetworkType(in unsigned long clientId,
-                                           in nsIDOMWindow window);
+  void getPreferredNetworkType(in unsigned long clientId,
+                               in nsIMobileConnectionCallback requestCallback);
 
   /**
    * 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'.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest setRoamingPreference(in unsigned long clientId,
-                                        in nsIDOMWindow window,
-                                        in DOMString mode);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
+   * 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'.
    *
-   * 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getRoamingPreference(in unsigned long clientId,
-                                        in nsIDOMWindow window);
+  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 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.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest setVoicePrivacyMode(in unsigned long clientId,
-                                       in nsIDOMWindow window,
-                                       in bool enabled);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
+   * If successful, the notifySuccessWithBoolean() will be called. And the result
+   * will be a boolean indicating the 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getVoicePrivacyMode(in unsigned long clientId,
-                                       in nsIDOMWindow window);
+  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 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
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * 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.
+   * If successful, the notifySendCancelMmiSuccess() will be called. And the
+   * result will contain the information about the mmi operation.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be a DOMMMIError.
-   * @see DOMMMIError for the detail of error.
+   * Otherwise, the notifyError() will be called.
    */
-  nsIDOMDOMRequest sendMMI(in unsigned long clientId,
-                           in nsIDOMWindow window,
-                           in DOMString mmi);
+  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 window
-   *        Current window.
-   *
-   * @return a nsIDOMDOMRequest
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * 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.
+   * If successful, the notifySendCancelMmiSuccess() will be called. And the
+   * result will contain the information about the mmi operation.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be a DOMMMIError.
-   * @see DOMMMIError for the detail of error.
+   * Otherwise, the notifyError() will be called.
    */
-  nsIDOMDOMRequest cancelMMI(in unsigned long clientId,
-                             in nsIDOMWindow window);
+  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 window
-   *        Current window.
    * @param reason
    *        Indicates the reason the call is being forwarded. It shall be one of
-   *        the nsIMobileConnectionProvider.CALL_FORWARD_REASON_* values.
+   *        the nsIMobileConnectionService.CALL_FORWARD_REASON_* values.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called. And the request's
+   * 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 request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'InvalidParameter', 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest getCallForwarding(in unsigned long clientId,
-                                     in nsIDOMWindow window,
-                                     in unsigned short reason);
+  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 window
-   *        Current window.
    * @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.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() 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'
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest setCallForwarding(in unsigned long clientId,
-                                     in nsIDOMWindow window,
-                                     in jsval options);
+  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 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
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * 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.
+   * If successful, the notifyGetCallBarringSuccess() will be called. And the
+   * result will contain 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', 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest getCallBarring(in unsigned long clientId,
-                                  in nsIDOMWindow window,
-                                  in jsval options);
+  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 window
-   *        Current window.
    * @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.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() 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'
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest setCallBarring(in unsigned long clientId,
-                                  in nsIDOMWindow window,
-                                  in jsval options);
+  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 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.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest changeCallBarringPassword(in unsigned long clientId,
-                                             in nsIDOMWindow window,
-                                             in jsval options);
+  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 window
-   *        Current window.
    * @param enabled
    *        Boolean indicates the desired call waiting status.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest setCallWaiting(in unsigned long clientId,
-                                  in nsIDOMWindow window,
-                                  in bool enabled);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
+   * If successful, the notifySuccessWithBoolean() will be called. And the result
+   * will be a boolean indicating the call waiting status.
    *
-   * 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getCallWaiting(in unsigned long clientId,
-                                  in nsIDOMWindow window);
+  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 window
-   *        Current window.
    * @param clirMode
-   *        One of the nsIMobileConnectionProvider.CLIR_* values.
+   *        One of the nsIMobileConnectionService.CLIR_* values.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
+   * If successful, the notifySuccess() will be called.
    *
-   * 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'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'InvalidParameter',
+   * 'IllegalSIMorME', or 'GenericFailure'.
    */
-  nsIDOMDOMRequest setCallingLineIdRestriction(in unsigned long clientId,
-                                               in nsIDOMWindow window,
-                                               in unsigned short clirMode);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called. And the request's
+   * 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 request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest getCallingLineIdRestriction(in unsigned long clientId,
-                                               in nsIDOMWindow window);
+  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 window
-   *        Current window.
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * @return a nsIDOMDOMRequest
-   *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'RadioNotAvailable', 'RequestNotSupported',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * Otherwise, the notifyError() will be called, and the error will be either
+   * 'RadioNotAvailable', 'RequestNotSupported', 'IllegalSIMorME', or
+   * 'GenericFailure'.
    */
-  nsIDOMDOMRequest exitEmergencyCbMode(in unsigned long clientId,
-                                       in nsIDOMWindow window);
+  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 window
-   *        Current window.
    * @param enabled
    *        Boolean indicates the desired radio power. True to enable the radio.
-   *
-   * @return a nsIDOMDOMRequest
+   * @param requestCallback
+   *        Called when request is finished.
    *
-   * If successful, the request's onsuccess will be called.
+   * If successful, the notifySuccess() will be called.
    *
-   * Otherwise, the request's onerror will be called, and the request's error
-   * will be either 'InvalidStateError', 'RadioNotAvailable',
-   * 'IllegalSIMorME', or 'GenericFailure'.
+   * 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.
    */
-  nsIDOMDOMRequest setRadioEnabled(in unsigned long clientId,
-                                   in nsIDOMWindow window,
-                                   in bool enabled);
+  void setRadioEnabled(in unsigned long clientId,
+                       in bool enabled,
+                       in nsIMobileConnectionCallback requestCallback);
 };