Bug 793137 - Part 1: IDL for PLAY_TONE, POLL_INTERVAL and REFRESH. r=philikon. sr=sicking
authorYoshi Huang <allstars.chh@mozilla.com>
Fri, 21 Sep 2012 17:35:51 +0800
changeset 112197 b4d33b66bfba37f5d1bfd79b9bef15c314df2eeb
parent 112196 33031c64f7d16d3b5fafa71ef6cbc857aeeb2482
child 112198 e60e324d1fa3a8ebcf90d59d558add9516e5326b
push idunknown
push userunknown
push dateunknown
reviewersphilikon, sicking
bugs793137
milestone18.0a1
Bug 793137 - Part 1: IDL for PLAY_TONE, POLL_INTERVAL and REFRESH. r=philikon. sr=sicking
dom/icc/interfaces/SimToolKit.idl
dom/icc/interfaces/nsIDOMIccManager.idl
--- a/dom/icc/interfaces/SimToolKit.idl
+++ b/dom/icc/interfaces/SimToolKit.idl
@@ -273,16 +273,56 @@ dictionary MozStkLocationInfo
   unsigned short gsmLocationAreaCode;
 
   /**
    * Mobile Cell ID for the current serving operator.
    */
   unsigned long gsmCellId;
 };
 
+dictionary MozStkDuration
+{
+  /**
+   * Time unit used, should be one of STK_TIME_UNIT_*.
+   */
+  unsigned short timeUnit;
+
+  /**
+   * The length of time required, expressed in timeUnit.
+   */
+  octet timeInterval;
+};
+
+dictionary MozStkPlayTone
+{
+  /**
+   * Text String.
+   */
+  DOMString text;
+
+  /**
+   * One of STK_TONE_TYPE_*.
+   */
+  unsigned short tone;
+
+  /**
+   * The length of time for which the ME shall generate the tone.
+   *
+   * @see MozStkDuration
+   */
+  jsval duration;
+
+  /**
+   * Need to vibrate or not.
+   * true: vibrate alert, if available, with the tone.
+   * false: use of vibrate alert is up to the ME.
+   */
+  boolean isVibrate;
+};
+
 dictionary MozStkLocationEvent
 {
   /**
    * The type of this event.
    * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LOCATION_STATUS;
    */
   unsigned short eventType;
 
@@ -349,16 +389,32 @@ dictionary MozStkCommand
    *
    * When typeOfCommand is
    * - STK_CMD_SET_UP_CALL
    * options is MozStkSetUpCall.
    *
    * When typeOfCommand is
    * - STK_CMD_SET_UP_EVENT_LIST
    * options is MozStkSetUpEventList.
+   *
+   * When typeOfCommand is
+   * - STK_CMD_PLAY_TONE
+   * options is MozStkPlayTone.
+   *
+   * When typeOfCommand is
+   * - STK_CMD_POLL_INTERVAL
+   * options is MozStkDuration.
+   *
+   * When typeOfCommand is
+   * - STK_CMD_POLL_OFF
+   * options is null.
+   *
+   * When typeOfCommand is
+   * - STK_CMD_REFRESH
+   * options is null.
    */
   jsval options;
 };
 
 [scriptable, builtinclass, uuid(06bbc6fa-9b59-4db6-b66b-3b26f9c379df)]
 interface nsIDOMMozStkCommandEvent : nsIDOMEvent
 {
   /**
--- a/dom/icc/interfaces/nsIDOMIccManager.idl
+++ b/dom/icc/interfaces/nsIDOMIccManager.idl
@@ -2,17 +2,17 @@
  * 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 "nsIDOMEventTarget.idl"
 #include "SimToolKit.idl"
 
 interface nsIDOMEventListener;
 
-[scriptable, builtinclass, uuid(b45c3873-88bd-4ae9-9c9b-10ee58ca5389)]
+[scriptable, builtinclass, uuid(9d898c66-3485-4cd5-ab8d-92ef2988887b)]
 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;
@@ -25,23 +25,26 @@ interface nsIDOMMozIccManager : nsIDOMEv
   const unsigned short STK_BROWSER_MODE_USING_NEW_BROWSER              = 0x03;
 
   /**
    * STK Proactive commands.
    *
    * @see TS 11.14, clause 13.4
    */
   const unsigned short STK_CMD_REFRESH               = 0x01;
+  const unsigned short STK_CMD_POLL_INTERVAL         = 0x03;
+  const unsigned short STK_CMD_POLL_OFF              = 0x04;
   const unsigned short STK_CMD_SET_UP_EVENT_LIST     = 0x05;
   const unsigned short STK_CMD_SET_UP_CALL           = 0x10;
   const unsigned short STK_CMD_SEND_SS               = 0x11;
   const unsigned short STK_CMD_SEND_USSD             = 0x12;
   const unsigned short STK_CMD_SEND_SMS              = 0x13;
   const unsigned short STK_CMD_SEND_DTMF             = 0x14;
   const unsigned short STK_CMD_LAUNCH_BROWSER        = 0x15;
+  const unsigned short STK_CMD_PLAY_TONE             = 0x20;
   const unsigned short STK_CMD_DISPLAY_TEXT          = 0x21;
   const unsigned short STK_CMD_GET_INKEY             = 0x22;
   const unsigned short STK_CMD_GET_INPUT             = 0x23;
   const unsigned short STK_CMD_SELECT_ITEM           = 0x24;
   const unsigned short STK_CMD_SET_UP_MENU           = 0x25;
   const unsigned short STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28;
 
   /**
@@ -165,16 +168,38 @@ interface nsIDOMMozIccManager : nsIDOMEv
    /**
     * The service state of STK Location Status.
     */
    const unsigned short STK_SERVICE_STATE_NORMAL      = 0x00;
    const unsigned short STK_SERVICE_STATE_LIMITED     = 0x01;
    const unsigned short STK_SERVICE_STATE_UNAVAILABLE = 0x02;
 
   /**
+   * Tone type.
+   */
+  const unsigned short STK_TONE_TYPE_DIAL_TONE                = 0x01;
+  const unsigned short STK_TONE_TYPE_CALLED_SUBSCRIBER_BUSY   = 0x02;
+  const unsigned short STK_TONE_TYPE_CONGESTION               = 0x03;
+  const unsigned short STK_TONE_TYPE_RADIO_PATH_ACK           = 0x04;
+  const unsigned short STK_TONE_TYPE_RADIO_PATH_NOT_AVAILABLE = 0x05;
+  const unsigned short STK_TONE_TYPE_ERROR                    = 0x06;
+  const unsigned short STK_TONE_TYPE_CALL_WAITING_TONE        = 0x07;
+  const unsigned short STK_TONE_TYPE_RINGING_TONE             = 0x08;
+  const unsigned short STK_TONE_TYPE_GENERAL_BEEP             = 0x10;
+  const unsigned short STK_TONE_TYPE_POSITIVE_ACK_TONE        = 0x11;
+  const unsigned short STK_TONE_TYPE_NEGATIVE_ACK_TONE        = 0x12;
+
+  /**
+   * Time unit
+   */
+  const unsigned short STK_TIME_UNIT_MINUTE       = 0x00;
+  const unsigned short STK_TIME_UNIT_SECOND       = 0x01;
+  const unsigned short STK_TIME_UNIT_TENTH_SECOND = 0x02;
+
+  /**
    * Send the response back to ICC after an attempt to execute STK Proactive
    * Command.
    *
    * @param command
    *        Command received from ICC. See MozStkCommand.
    * @param response
    *        The response that will be sent to ICC.
    * @see MozStkResponse for the detail of response.