Bug 860585 - Part 1: Move cardLock API from mozMobileConnection to mozIccManager (IDL). r=allstars.chh. sr=sicking
authorEdgar Chen <echen@mozilla.com>
Thu, 11 Apr 2013 11:19:36 +0800
changeset 146524 93841dcb2fd133f922e72de003f6885be108e1c6
parent 146523 37625e20283957d8700a3faa8ba41cb0966d63f0
child 146525 022e181285dd652c8ab616d2193435b5c881fdcc
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersallstars, sicking
bugs860585
milestone24.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 860585 - Part 1: Move cardLock API from mozMobileConnection to mozIccManager (IDL). r=allstars.chh. sr=sicking
dom/icc/interfaces/moz.build
dom/icc/interfaces/nsIDOMICCCardLockErrorEvent.idl
dom/icc/interfaces/nsIDOMIccCardLockErrorEvent.idl
dom/icc/interfaces/nsIDOMIccManager.idl
dom/icc/interfaces/nsIIccProvider.idl
dom/network/interfaces/nsIDOMMobileConnection.idl
dom/network/interfaces/nsIMobileConnectionProvider.idl
js/xpconnect/src/event_impl_gen.conf.in
--- a/dom/icc/interfaces/moz.build
+++ b/dom/icc/interfaces/moz.build
@@ -1,17 +1,17 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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 += [
     'SimToolKit.idl',
-    'nsIDOMICCCardLockErrorEvent.idl',
+    'nsIDOMIccCardLockErrorEvent.idl',
     'nsIDOMIccManager.idl',
     'nsIIccProvider.idl',
     'nsINavigatorIccManager.idl',
 ]
 
 XPIDL_MODULE = 'dom_icc'
 
 XPIDL_FLAGS += [
rename from dom/icc/interfaces/nsIDOMICCCardLockErrorEvent.idl
rename to dom/icc/interfaces/nsIDOMIccCardLockErrorEvent.idl
--- a/dom/icc/interfaces/nsIDOMICCCardLockErrorEvent.idl
+++ b/dom/icc/interfaces/nsIDOMIccCardLockErrorEvent.idl
@@ -1,24 +1,24 @@
 /* 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 "nsIDOMEvent.idl"
 
-[scriptable, builtinclass, uuid(05d269bc-7049-4df8-b72f-4318aaee54de)]
-interface nsIDOMICCCardLockErrorEvent : nsIDOMEvent
+[scriptable, builtinclass, uuid(47d4db10-a258-11e2-9e96-0800200c9a66)]
+interface nsIDOMIccCardLockErrorEvent : nsIDOMEvent
 {
   readonly attribute DOMString lockType;
   readonly attribute long retryCount;
 
-  [noscript] void initICCCardLockErrorEvent(in DOMString aType,
+  [noscript] void initIccCardLockErrorEvent(in DOMString aType,
                                             in boolean aCanBubble,
                                             in boolean aCancelable,
                                             in DOMString aLockType,
                                             in int32_t aRetryCount);
 };
 
-dictionary ICCCardLockErrorEventInit : EventInit
+dictionary IccCardLockErrorEventInit : EventInit
 {
   DOMString  lockType;
   long       retryCount;
 };
--- a/dom/icc/interfaces/nsIDOMIccManager.idl
+++ b/dom/icc/interfaces/nsIDOMIccManager.idl
@@ -4,17 +4,17 @@
 
 #include "nsIDOMEventTarget.idl"
 #include "SimToolKit.idl"
 
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMContact;
 
-[scriptable, builtinclass, uuid(fcc1971a-ddb7-4b38-8474-25bef7e5bf40)]
+[scriptable, builtinclass, uuid(b4e16bb0-a258-11e2-9e96-0800200c9a66)]
 interface nsIDOMMozIccManager : nsIDOMEventTarget
 {
   /**
    * STK Menu Presentation types.
    */
   const unsigned short STK_MENU_TYPE_NOT_SPECIFIED      = 0x00;
   const unsigned short STK_MENU_TYPE_DATA_VALUES        = 0x01;
   const unsigned short STK_MENU_TYPE_NAVIGATION_OPTIONS = 0x03;
@@ -270,16 +270,157 @@ interface nsIDOMMozIccManager : nsIDOMEv
   [implicit_jscontext] attribute jsval onstkcommand;
 
   /**
    * 'stksessionend' event is notified whenever STK Session is terminated by
    * ICC.
    */
   [implicit_jscontext] attribute jsval onstksessionend;
 
+  // UICC Card Lock interfaces.
+
+  /**
+   * Find out about the status of an ICC lock (e.g. the PIN lock).
+   *
+   * @param lockType
+   *        Identifies the lock type, e.g. "pin" for the PIN lock, "fdn" for
+   *        the FDN lock.
+   *
+   * @return a DOM Request.
+   *         The request's result will be an object containing
+   *         information about the specified lock's status,
+   *         e.g. {lockType: "pin", enabled: true}.
+   */
+  nsIDOMDOMRequest getCardLock(in DOMString lockType);
+
+  /**
+   * Unlock a card lock.
+   *
+   * @param info
+   *        An object containing the information necessary to unlock
+   *        the given lock. At a minimum, this object must have a
+   *        "lockType" attribute which specifies the type of lock, e.g.
+   *        "pin" for the PIN lock. Other attributes are dependent on
+   *        the lock type.
+   *
+   * Examples:
+   *
+   * (1) Unlocking the PIN:
+   *
+   *   unlockCardLock({lockType: "pin",
+   *                   pin: "..."});
+   *
+   * (2) Unlocking the PUK and supplying a new PIN:
+   *
+   *   unlockCardLock({lockType: "puk",
+   *                   puk: "...",
+   *                   newPin: "..."});
+   *
+   * (3) Network depersonalization. Unlocking the network control key (NCK).
+   *
+   *   unlockCardLock({lockType: "nck",
+   *                   pin: "..."});
+   *
+   * (4) Corporate depersonalization. Unlocking the corporate control key (CCK).
+   *
+   *   unlockCardLock({lockType: "cck",
+   *                   pin: "..."});
+   *
+   * (5) Service Provider depersonalization. Unlocking the service provider
+   *     control key (SPCK).
+   *
+   *   unlockCardLock({lockType: "spck",
+   *                   pin: "..."});
+   *
+   * @return a nsIDOMDOMRequest.
+   *         The request's result will be an object containing
+   *         information about the unlock operation.
+   *
+   * Examples:
+   *
+   * (1) Unlocking failed:
+   *
+   *     {
+   *       lockType:   "pin",
+   *       success:    false,
+   *       retryCount: 2
+   *     }
+   *
+   * (2) Unlocking succeeded:
+   *
+   *     {
+   *       lockType:  "pin",
+   *       success:   true
+   *     }
+   */
+  nsIDOMDOMRequest unlockCardLock(in jsval info);
+
+  /**
+   * Modify the state of a card lock.
+   *
+   * @param info
+   *        An object containing information about the lock and
+   *        how to modify its state. At a minimum, this object
+   *        must have a "lockType" attribute which specifies the
+   *        type of lock, e.g. "pin" for the PIN lock. Other
+   *        attributes are dependent on the lock type.
+   *
+   * Examples:
+   *
+   * (1a) Disabling the PIN lock:
+   *
+   *   setCardLock({lockType: "pin",
+   *                pin: "...",
+   *                enabled: false});
+   *
+   * (1b) Disabling the FDN lock:
+   *
+   *   setCardLock({lockType: "fdn",
+   *                pin2: "...",
+   *                enabled: false});
+   *
+   * (2) Changing the PIN:
+   *
+   *   setCardLock({lockType: "pin",
+   *                pin: "...",
+   *                newPin: "..."});
+   *
+   * @return a nsIDOMDOMRequest.
+   *         The request's result will be an object containing
+   *         information about the operation.
+   *
+   * Examples:
+   *
+   * (1) Enabling/Disabling card lock failed or change card lock failed.
+   *
+   *     {
+   *       lockType: "pin",
+   *       success: false,
+   *       retryCount: 2
+   *     }
+   *
+   * (2) Enabling/Disabling card lock succeed or change card lock succeed.
+   *
+   *     {
+   *       lockType: "pin",
+   *       success: true
+   *     }
+   */
+  nsIDOMDOMRequest setCardLock(in jsval info);
+
+  /**
+   * The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
+   * 'setCardLock' fails.
+   *
+   * The result will be an object containing information
+   * about the specified lock's status,
+   * e.g. {lockType: "pin", retryCount: 2}.
+   */
+  [implicit_jscontext] attribute jsval onicccardlockerror;
+
   // UICC Phonebook Interfaces.
 
   /**
    * Read ICC contacts.
    *
    * @param contactType
    *        One of type as below,
    *        - 'adn': Abbreviated Dialling Number
--- a/dom/icc/interfaces/nsIIccProvider.idl
+++ b/dom/icc/interfaces/nsIIccProvider.idl
@@ -3,27 +3,29 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 interface nsIDOMWindow;
 interface nsIDOMDOMRequest;
 interface nsIDOMContact;
 
-[scriptable, uuid(f383a42b-0961-4bb0-b45e-dbc345d59237)]
+[scriptable, uuid(dca08580-a25a-11e2-9e96-0800200c9a66)]
 interface nsIIccListener : nsISupports
 {
   void notifyStkCommand(in DOMString aMessage);
   void notifyStkSessionEnd();
+  void notifyIccCardLockError(in DOMString lockType,
+                              in unsigned long retryCount);
 };
 
 /**
  * XPCOM component (in the content process) that provides the ICC information.
  */
-[scriptable, uuid(041aee4f-fad0-4ed8-a11c-774b1aedd09e)]
+[scriptable, uuid(e60ec460-a25a-11e2-9e96-0800200c9a66)]
 interface nsIIccProvider : 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 registerIccMsg(in nsIIccListener listener);
@@ -39,16 +41,23 @@ interface nsIIccProvider : nsISupports
                             in unsigned short itemIdentifier,
                             in boolean        helpRequested);
   void sendStkTimerExpiration(in nsIDOMWindow window,
                               in jsval        timer);
   void sendStkEventDownload(in nsIDOMWindow window,
                             in jsval        event);
 
   /**
+   * Card lock interfaces.
+   */
+  nsIDOMDOMRequest getCardLockState(in nsIDOMWindow window, in DOMString lockType);
+  nsIDOMDOMRequest unlockCardLock(in nsIDOMWindow window, in jsval info);
+  nsIDOMDOMRequest setCardLock(in nsIDOMWindow window, in jsval info);
+
+  /**
    * Phonebook interfaces.
    */
   nsIDOMDOMRequest readContacts(in nsIDOMWindow window,
                                 in DOMString contactType);
 
   nsIDOMDOMRequest updateContact(in nsIDOMWindow window,
                                  in DOMString contactType,
                                  in nsIDOMContact contact,
--- a/dom/network/interfaces/nsIDOMMobileConnection.idl
+++ b/dom/network/interfaces/nsIDOMMobileConnection.idl
@@ -7,17 +7,17 @@
 interface nsIDOMEventListener;
 interface nsIDOMDOMRequest;
 interface nsIDOMMozMobileICCInfo;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCellInfo;
 interface nsIDOMMozMobileCFInfo;
 
-[scriptable, builtinclass, uuid(2566dcb8-c82f-4420-a807-0806bd01a3b4)]
+[scriptable, builtinclass, uuid(c7fdf0f0-a740-11e2-9e96-0800200c9a66)]
 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);
@@ -120,145 +120,16 @@ interface nsIDOMMozMobileConnection : ns
    *
    * Otherwise, the request's onerror will be called, and the request's error
    * will be either 'RadioNotAvailable', 'RequestNotSupported',
    * 'IllegalSIMorME', or 'GenericFailure'
    */
   nsIDOMDOMRequest selectNetworkAutomatically();
 
   /**
-   * Find out about the status of an ICC lock (e.g. the PIN lock).
-   *
-   * @param lockType
-   *        Identifies the lock type, e.g. "pin" for the PIN lock, "fdn" for
-   *        the FDN lock.
-   *
-   * @return a DOM Request.
-   *         The request's result will be an object containing
-   *         information about the specified lock's status,
-   *         e.g. {lockType: "pin", enabled: true}.
-   */
-  nsIDOMDOMRequest getCardLock(in DOMString lockType);
-
-  /**
-   * Unlock a card lock.
-   *
-   * @param info
-   *        An object containing the information necessary to unlock
-   *        the given lock. At a minimum, this object must have a
-   *        "lockType" attribute which specifies the type of lock, e.g.
-   *        "pin" for the PIN lock. Other attributes are dependent on
-   *        the lock type.
-   *
-   * Examples:
-   *
-   * (1) Unlocking the PIN:
-   *
-   *   unlockCardLock({lockType: "pin",
-   *                   pin: "..."});
-   *
-   * (2) Unlocking the PUK and supplying a new PIN:
-   *
-   *   unlockCardLock({lockType: "puk",
-   *                   puk: "...",
-   *                   newPin: "..."});
-   *
-   * (3) Network depersonalization. Unlocking the network control key (NCK).
-   *
-   *   unlockCardLock({lockType: "nck",
-   *                   pin: "..."});
-   *
-   * (4) Corporate depersonalization. Unlocking the corporate control key (CCK).
-   *
-   *   unlockCardLock({lockType: "cck",
-   *                   pin: "..."});
-   *
-   * (5) Service Provider depersonalization. Unlocking the service provider
-   *     control key (SPCK).
-   *
-   *   unlockCardLock({lockType: "spck",
-   *                   pin: "..."});
-   *
-   * @return a nsIDOMDOMRequest.
-   *         The request's result will be an object containing
-   *         information about the unlock operation.
-   *
-   * Examples:
-   *
-   * (1) Unlocking failed:
-   *
-   *     {
-   *       lockType:   "pin",
-   *       success:    false,
-   *       retryCount: 2
-   *     }
-   *
-   * (2) Unlocking succeeded:
-   *
-   *     {
-   *       lockType:  "pin",
-   *       success:   true
-   *     }
-   */
-  nsIDOMDOMRequest unlockCardLock(in jsval info);
-
-  /**
-   * Modify the state of a card lock.
-   *
-   * @param info
-   *        An object containing information about the lock and
-   *        how to modify its state. At a minimum, this object
-   *        must have a "lockType" attribute which specifies the
-   *        type of lock, e.g. "pin" for the PIN lock. Other
-   *        attributes are dependent on the lock type.
-   *
-   * Examples:
-   *
-   * (1a) Disabling the PIN lock:
-   *
-   *   setCardLock({lockType: "pin",
-   *                pin: "...",
-   *                enabled: false});
-   *
-   * (1b) Disabling the FDN lock:
-   *
-   *   setCardLock({lockType: "fdn",
-   *                pin2: "...",
-   *                enabled: false});
-   *
-   * (2) Changing the PIN:
-   *
-   *   setCardLock({lockType: "pin",
-   *                pin: "...",
-   *                newPin: "..."});
-   *
-   * @return a nsIDOMDOMRequest.
-   *         The request's result will be an object containing
-   *         information about the operation.
-   *
-   * Examples:
-   *
-   * (1) Enabling/Disabling card lock failed or change card lock failed.
-   *
-   *     {
-   *       lockType: "pin",
-   *       success: false,
-   *       retryCount: 2
-   *     }
-   *
-   * (2) Enabling/Disabling card lock succeed or change card lock succeed.
-   *
-   *     {
-   *       lockType: "pin",
-   *       success: true
-   *     }
-   */
-  nsIDOMDOMRequest setCardLock(in jsval info);
-
-  /**
    * Send a MMI message.
    *
    * @param mmi
    *        DOMString containing an MMI string that can be associated to a
    *        USSD request or other RIL functionality.
    *
    * @return a nsIDOMDOMRequest
    *         The request's result will be an object containing information
@@ -401,22 +272,16 @@ interface nsIDOMMozMobileConnection : ns
 
   /**
    * The 'dataerror' event is notified whenever the data connection object
    * receives an error from the RIL
    */
   [implicit_jscontext] attribute jsval ondataerror;
 
   /**
-   * The 'icccardlockerror' event is notified whenever 'unlockCardLock' or
-   * 'setCardLock' fails.
-   */
-  [implicit_jscontext] attribute jsval onicccardlockerror;
-
-  /**
    * The 'oncfstatechange' event is notified whenever the call forwarding
    * state changes.
    */
   [implicit_jscontext] attribute jsval oncfstatechange;
 };
 
 [scriptable, uuid(c9d9ff61-a2f0-41cd-b478-9cefa7b31f31)]
 interface nsIDOMMozMobileConnectionInfo : nsISupports
--- a/dom/network/interfaces/nsIMobileConnectionProvider.idl
+++ b/dom/network/interfaces/nsIMobileConnectionProvider.idl
@@ -6,41 +6,39 @@
 
 interface nsIDOMMozMobileICCInfo;
 interface nsIDOMMozMobileConnectionInfo;
 interface nsIDOMMozMobileNetworkInfo;
 interface nsIDOMMozMobileCFInfo;
 interface nsIDOMDOMRequest;
 interface nsIDOMWindow;
 
-[scriptable, uuid(d919e279-b0e4-4bc0-8464-f5b37aa41484)]
+[scriptable, uuid(d09099b0-a25a-11e2-9e96-0800200c9a66)]
 interface nsIMobileConnectionListener : nsISupports
 {
   void notifyVoiceChanged();
   void notifyDataChanged();
   void notifyCardStateChanged();
   void notifyIccInfoChanged();
   void notifyUssdReceived(in DOMString message,
                           in boolean sessionEnded);
   void notifyDataError(in DOMString message);
-  void notifyIccCardLockError(in DOMString lockType,
-                              in unsigned long retryCount);
   void notifyCFStateChange(in boolean success,
                            in unsigned short action,
                            in unsigned short reason,
                            in DOMString number,
                            in unsigned short timeSeconds,
                            in unsigned short serviceClass);
 };
 
 /**
  * XPCOM component (in the content process) that provides the mobile
  * network information.
  */
-[scriptable, uuid(0abc25f7-372e-4398-8b49-ae8fcdb575d3)]
+[scriptable, uuid(b9605230-a25a-11e2-9e96-0800200c9a66)]
 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);
@@ -52,20 +50,16 @@ interface nsIMobileConnectionProvider : 
   readonly attribute nsIDOMMozMobileConnectionInfo voiceConnectionInfo;
   readonly attribute nsIDOMMozMobileConnectionInfo dataConnectionInfo;
   readonly attribute DOMString networkSelectionMode;
 
   nsIDOMDOMRequest getNetworks(in nsIDOMWindow window);
   nsIDOMDOMRequest selectNetwork(in nsIDOMWindow window, in nsIDOMMozMobileNetworkInfo network);
   nsIDOMDOMRequest selectNetworkAutomatically(in nsIDOMWindow window);
 
-  nsIDOMDOMRequest getCardLock(in nsIDOMWindow window, in DOMString lockType);
-  nsIDOMDOMRequest unlockCardLock(in nsIDOMWindow window, in jsval info);
-  nsIDOMDOMRequest setCardLock(in nsIDOMWindow window, in jsval info);
-
   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);
 
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -29,17 +29,17 @@ simple_events = [
     'StyleSheetApplicableStateChangeEvent',
 #ifdef MOZ_B2G_BT
     'BluetoothDeviceEvent',
 #endif
 #ifdef MOZ_B2G_RIL
     'CallEvent',
     'CFStateChangeEvent',
     'DataErrorEvent',
-    'ICCCardLockErrorEvent',
+    'IccCardLockErrorEvent',
     'MozWifiStatusChangeEvent',
     'MozWifiConnectionInfoEvent',
     'MozCellBroadcastEvent',
     'MozVoicemailEvent',
     'USSDReceivedEvent',
 #endif
     'ElementReplaceEvent',
     'MozSmsEvent',