Bug 1162464 - Part 1: IDL Changes. r=echen
authorBevis Tseng <btseng@mozilla.com>
Fri, 08 May 2015 10:57:16 +0800
changeset 244209 579df6b63b9e5a26b2bc68b08df27833f2a860ec
parent 244208 35918b0441b4ea614185fe2df5e8de4db9fb28d9
child 244210 9f0d8d7bc7a14ba1fd3e8d6cde381f9fea874010
push id28771
push usercbook@mozilla.com
push dateMon, 18 May 2015 11:22:49 +0000
treeherdermozilla-central@79ce87dbf4a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1162464
milestone41.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 1162464 - Part 1: IDL Changes. r=echen
dom/icc/interfaces/nsIIccProvider.idl
dom/icc/interfaces/nsIIccService.idl
--- a/dom/icc/interfaces/nsIIccProvider.idl
+++ b/dom/icc/interfaces/nsIIccProvider.idl
@@ -1,61 +1,22 @@
 /* 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 nsIIccInfo;
 interface nsIIccListener;
 
-[scriptable, uuid(6136acab-b50e-494a-a86d-df392a032897)]
-interface nsIIccChannelCallback : nsISupports
-{
-  /**
-   * Callback function to notify on successfully opening a logical channel.
-   *
-   * @param channel
-   *        The Channel Number/Handle that is successfully opened.
-   */
-  void notifyOpenChannelSuccess(in long channel);
-
-  /**
-   * Callback function to notify on successfully closing the logical channel.
-   *
-   */
-  void notifyCloseChannelSuccess();
-
-  /**
-   * Callback function to notify the status of 'iccExchangeAPDU' command.
-   *
-   * @param sw1
-   *        Response's First Status Byte
-   * @param sw2
-   *        Response's Second Status Byte
-   * @param data
-   *        Response's data
-   */
-  void notifyExchangeAPDUResponse(in octet sw1,
-                                  in octet sw2,
-                                  in DOMString data);
-
-  /**
-   * Callback function to notify error
-   *
-   */
-  void notifyError(in DOMString error);
-};
-
 /**
  * XPCOM component (in the content process) that provides the ICC information.
  */
-[scriptable, uuid(7dd6e186-b007-11e4-9b7e-7717d7863cb8)]
+[scriptable, uuid(2fbacfc4-f52d-11e4-9667-33b72f279d14)]
 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 unsigned long clientId, in nsIIccListener listener);
@@ -86,37 +47,9 @@ interface nsIIccProvider : nsISupports
                                 in nsIDOMWindow window,
                                 in unsigned long contactType);
 
   nsIDOMDOMRequest updateContact(in unsigned long clientId,
                                  in nsIDOMWindow window,
                                  in unsigned long contactType,
                                  in jsval contact,
                                  in DOMString pin2);
-
-  /**
-   * Secure Card Icc communication channel
-   */
-  void iccOpenChannel(in unsigned long clientId,
-                      in DOMString aid,
-                      in nsIIccChannelCallback callback);
-
-  /**
-   * Exchange Command APDU (C-APDU) with SIM on the given logical channel.
-   * Note that 'P3' parameter could be Le/Lc depending on command APDU case.
-   * For Case 1 scenario (when only command header is present), the value
-   * of 'P3' should be set to '-1' explicitly.
-   * Refer to 3G TS 31.101 , 10.2 'Command APDU Structure' for all the cases.
-   */
-  void iccExchangeAPDU(in unsigned long clientId,
-                       in long channel,
-                       in octet cla,
-                       in octet ins,
-                       in octet p1,
-                       in octet p2,
-                       in short p3,
-                       in DOMString data,
-                       in nsIIccChannelCallback callback);
-
-  void iccCloseChannel(in unsigned long clientId,
-                       in long channel,
-                       in nsIIccChannelCallback callback);
 };
--- a/dom/icc/interfaces/nsIIccService.idl
+++ b/dom/icc/interfaces/nsIIccService.idl
@@ -58,16 +58,54 @@ interface nsIIccCallback : nsISupports
    * @param aErrorMsg
    *        The error message.
    * @param aRetryCount
    *        The number of remaining retries. -1 if unknown.
    */
   void notifyCardLockError(in DOMString aErrorMsg, in long aRetryCount);
 };
 
+[scriptable, uuid(6136acab-b50e-494a-a86d-df392a032897)]
+interface nsIIccChannelCallback : nsISupports
+{
+  /**
+   * Callback function to notify on successfully opening a logical channel.
+   *
+   * @param channel
+   *        The Channel Number/Handle that is successfully opened.
+   */
+  void notifyOpenChannelSuccess(in long channel);
+
+  /**
+   * Callback function to notify on successfully closing the logical channel.
+   *
+   */
+  void notifyCloseChannelSuccess();
+
+  /**
+   * Callback function to notify the status of 'iccExchangeAPDU' command.
+   *
+   * @param sw1
+   *        Response's First Status Byte
+   * @param sw2
+   *        Response's Second Status Byte
+   * @param data
+   *        Response's data
+   */
+  void notifyExchangeAPDUResponse(in octet sw1,
+                                  in octet sw2,
+                                  in DOMString data);
+
+  /**
+   * Callback function to notify error
+   *
+   */
+  void notifyError(in DOMString error);
+};
+
 %{C++
 #define ICC_SERVICE_CID \
   { 0xbab0277a, 0x900e, 0x11e4, { 0x80, 0xc7, 0xdb, 0xd7, 0xad, 0x05, 0x24, 0x01 } }
 #define ICC_SERVICE_CONTRACTID \
   "@mozilla.org/icc/iccservice;1"
 
 template<typename T> struct already_AddRefed;
 %}
@@ -92,17 +130,17 @@ interface nsIIccService : nsISupports
 %{C++
 already_AddRefed<nsIIccService>
 NS_CreateIccService();
 %}
 
 /**
  * XPCOM component that provides the access to the selected ICC.
  */
-[scriptable, uuid(20a99186-e4cb-11e4-a5f9-938abcf7c826)]
+[scriptable, uuid(6ad6b686-f52d-11e4-942d-db2884bd9242)]
 interface nsIIcc : nsISupports
 {
   /**
    * Card State Constants
    *
    * Note: MUST be matched with enum IccCardState in MozIcc.webidl!
    */
   const unsigned long CARD_STATE_UNKNOWN = 0;
@@ -326,9 +364,66 @@ interface nsIIcc : nsISupports
    *        One of CARD_SERVICE_* values.
    * @param aCallback
    *        An instance of nsIIccCallback:
    *        nsIIccCallback::notifySuccessWithBoolean() if success.
    *        nsIIccCallback::notifyError(), otherwise.
    */
   void getServiceStateEnabled(in unsigned long aService,
                               in nsIIccCallback aCallback);
+
+  /**
+   * Open Secure Card Icc communication channel
+   *
+   * @param aAid
+   *        Card Application Id in this UICC.
+   * @param aCallback
+   *        An instance of nsIIccChannelCallback.
+   *        nsIIccChannelCallback::notifyOpenChannelSuccess() if success.
+   *        nsIIccChannelCallback::notifyError(), otherwise.
+   */
+  void iccOpenChannel(in DOMString aAid,
+                      in nsIIccChannelCallback aCallback);
+
+  /**
+   * Exchange Command APDU (C-APDU) with UICC on the given logical channel.
+   * Note that 'P3' parameter could be Le/Lc depending on command APDU case.
+   * For Case 1 scenario (when only command header is present), the value
+   * of 'P3' should be set to '-1' explicitly.
+   * Refer to 3G TS 31.101 , 10.2 'Command APDU Structure' for all the cases.
+   *
+   * @param aChannel
+   *        given logical channel.
+   * @param aCla
+   *        APDU class.
+   * @param aIns
+   *        Instruction code.
+   * @param aP1, aP2, aP3
+   *        P1, P2, P3 parameters in APDU.
+   * @param aData
+   *        The hex data to be sent by this PDU.
+   * @param aCallback
+   *        An instance of nsIIccChannelCallback.
+   *        nsIIccChannelCallback::notifyExchangeAPDUResponse() if success.
+   *        nsIIccChannelCallback::notifyError(), otherwise.
+   */
+  void iccExchangeAPDU(in long aChannel,
+                       in octet aCla,
+                       in octet aIns,
+                       in octet aP1,
+                       in octet aP2,
+                       in short aP3,
+                       in DOMString aData,
+                       in nsIIccChannelCallback aCallback);
+
+  /**
+   * Close Secure Card Icc communication channel
+   *
+   * @param aChannel
+   *        Channel to be closed.
+   * @param aCallback
+   *        An instance of nsIIccChannelCallback.
+   *        nsIIccChannelCallback::notifyCloseChannelSuccess() if success.
+   *        nsIIccChannelCallback::notifyError(), otherwise.
+   */
+  void iccCloseChannel(in long aChannel,
+                       in nsIIccChannelCallback aCallback);
 };