Bug 818393 - Part 1: Add interface for call barring config. r=htsai. sr=mounir.
authorSzu-Yu Chen [:aknow] <szchen@mozilla.com>
Tue, 21 May 2013 13:08:57 +0800
changeset 139531 c5c2d7b04b97f68716e37c5ed78ab32bbe4f8a3e
parent 139530 7c954165378120c1a3a3d5b0ba95974476fc586a
child 139532 5300a886b3c1491b6588519050d6ca686d4215e8
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershtsai, mounir
bugs818393
milestone24.0a1
Bug 818393 - Part 1: Add interface for call barring config. r=htsai. sr=mounir. --- dom/network/interfaces/nsIDOMMobileConnection.idl | 84 +++++++++++++++++++- .../interfaces/nsIMobileConnectionProvider.idl | 7 +- 2 files changed, 87 insertions(+), 4 deletions(-)
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/interfaces/nsIMobileConnectionProvider.idl
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -7,30 +7,45 @@
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileICCInfo;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCellInfo;
 interface nsIDOMMozMobileCFInfo;
 
-[scriptable, builtinclass, uuid(dd590ea0-a711-11e2-9e96-0800200c9a66)]
+[scriptable, builtinclass, uuid(2566dcb8-c82f-4420-a807-0806bd01a3b4)]
 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;
+
+  /**
    * These two fields can be accessed by privileged applications with the
    * 'mobilenetwork' permission.
    */
   readonly attribute DOMString lastKnownNetwork;
   readonly attribute DOMString lastKnownHomeNetwork;
 
   /**
    * Indicates the state of the device's ICC card.
@@ -290,16 +305,49 @@ interface nsIDOMMozMobileConnection : ns
    *
    * Otherwise, the request's onerror will be called, and the request's error
    * will be either 'RadioNotAvailable', 'RequestNotSupported',
    * 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', 'InvalidCallBarringOption' 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',
+   * 'InvalidCallBarringOption' or 'GenericFailure'.
+   */
+  nsIDOMDOMRequest getCallBarringOption(in jsval option);
+
+  /**
    * 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
@@ -377,17 +425,17 @@ interface nsIDOMMozMobileConnectionInfo 
    * State of the connection.
    *
    * Possible values: 'notSearching', 'searching', 'denied', 'registered'.
    * null if the state is unknown.
    */
   readonly attribute DOMString state;
 
   /**
-   * Indicates whether the connection is ready. This may be different 
+   * Indicates whether the connection is ready. This may be different
    */
   readonly attribute bool connected;
 
   /**
    * Indicates whether only emergency calls are possible.
    *
    * This flag is only relevant to voice connections and when 'connected' is
    * false.
@@ -579,12 +627,42 @@ interface nsIDOMMozMobileCFInfo : nsISup
   /**
    * 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
-   * nsIDOMMozMobileConnectionInfo.ICC_SERVICE_CLASS_* values.
+   * nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_* values.
    */
   readonly attribute unsigned short serviceClass;
 };
+
+
+dictionary MozCallBarringOption
+{
+  /**
+   * Indicates the program the call is being barred.
+   *
+   * It shall be one of the nsIDOMMozMobileConnection.CALL_BARRING_PROGRAM_*
+   * values.
+   */
+   unsigned short program;
+
+  /**
+   * Enable or disable the call barring program.
+   */
+  boolean enabled;
+
+  /**
+   * Barring password. Use "" if no password specified.
+   */
+  DOMString password;
+
+  /**
+   * Service for which the call barring is set up.
+   *
+   * It shall be one of the nsIDOMMozMobileConnection.ICC_SERVICE_CLASS_*
+   * values.
+   */
+  unsigned short serviceClass;
+};
--- a/dom/network/interfaces/nsIMobileConnectionProvider.idl
+++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl
@@ -30,17 +30,17 @@ interface nsIMobileConnectionListener : 
                            in unsigned short timeSeconds,
                            in unsigned short serviceClass);
 };
 
 /**
  * XPCOM component (in the content process) that provides the mobile
  * network information.
  */
-[scriptable, uuid(3b02afb4-2fc5-471a-b529-816125bf90ae)]
+[scriptable, uuid(0abc25f7-372e-4398-8b49-ae8fcdb575d3)]
 interface nsIMobileConnectionProvider : nsISupports
 {
   /**
    * 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 nsIMobileConnectionListener listener);
@@ -64,12 +64,17 @@ interface nsIMobileConnectionProvider : 
   nsIDOMDOMRequest sendMMI(in nsIDOMWindow window, in DOMString mmi);
   nsIDOMDOMRequest cancelMMI(in nsIDOMWindow window);
 
   nsIDOMDOMRequest getCallForwardingOption(in nsIDOMWindow   window,
                                            in unsigned short reason);
   nsIDOMDOMRequest setCallForwardingOption(in nsIDOMWindow          window,
                                            in nsIDOMMozMobileCFInfo CFInfo);
 
+  nsIDOMDOMRequest getCallBarringOption(in nsIDOMWindow window,
+                                        in jsval        option);
+  nsIDOMDOMRequest setCallBarringOption(in nsIDOMWindow window,
+                                        in jsval        option);
+
   nsIDOMDOMRequest setCallWaitingOption(in nsIDOMWindow   window,
                                         in bool enabled);
   nsIDOMDOMRequest getCallWaitingOption(in nsIDOMWindow   window);
 };