Bug 1117609 - Part 1: Add Support of "Additional Info on Result" in STK Terminal Response. r=echen, r=hsinyi
authorBevis Tseng <btseng@mozilla.com>
Mon, 05 Jan 2015 16:05:17 +0800
changeset 253557 a558364e10212b5e74b46f53af116009abb25bed
parent 253556 cb49fd041f7afbedb42c2566a4521446698a6f65
child 253558 ee6a7811ff8c722d4520a4872878f02d44a2d309
push id721
push userjlund@mozilla.com
push dateTue, 21 Apr 2015 23:03:33 +0000
treeherdermozilla-release@d27c9211ebb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen, hsinyi
bugs1117609
milestone38.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 1117609 - Part 1: Add Support of "Additional Info on Result" in STK Terminal Response. r=echen, r=hsinyi
dom/system/gonk/ril_worker.js
dom/webidl/MozIccManager.webidl
dom/webidl/MozStkCommandEvent.webidl
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -2918,16 +2918,17 @@ RilObject.prototype = {
   },
 
   /**
    * Send STK terminal response.
    *
    * @param command
    * @param deviceIdentities
    * @param resultCode
+   * @param [optional] additionalInformation
    * @param [optional] itemIdentifier
    * @param [optional] input
    * @param [optional] isYesNo
    * @param [optional] hasConfirmed
    * @param [optional] localInfo
    * @param [optional] timer
    */
   sendStkTerminalResponse: function(response) {
@@ -2973,18 +2974,35 @@ RilObject.prototype = {
     GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_DEVICE_ID);
     GsmPDUHelper.writeHexOctet(2);
     GsmPDUHelper.writeHexOctet(STK_DEVICE_ID_ME);
     GsmPDUHelper.writeHexOctet(STK_DEVICE_ID_SIM);
 
     // Result
     GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_RESULT |
                                COMPREHENSIONTLV_FLAG_CR);
-    GsmPDUHelper.writeHexOctet(1);
-    GsmPDUHelper.writeHexOctet(response.resultCode);
+    if ("additionalInformation" in response) {
+      // In |12.12 Result| TS 11.14, the length of additional information is
+      // varied and all possible values are addressed in 12.12.1-11 of TS 11.14
+      // and 8.12.1-13 in TS 31.111.
+      // However,
+      // 1. Only SEND SS requires info with more than 1 octet.
+      // 2. In rild design, SEND SS is expected to be handled by modem and
+      //    UNSOLICITED_STK_EVENT_NOTIFY will be sent to application layer to
+      //    indicate appropriate messages to users. TR is not required in this
+      //    case.
+      // Hence, we simplify the structure of |additionalInformation| to a
+      // numeric value instead of a octet array.
+      GsmPDUHelper.writeHexOctet(2);
+      GsmPDUHelper.writeHexOctet(response.resultCode);
+      GsmPDUHelper.writeHexOctet(response.additionalInformation);
+    } else {
+      GsmPDUHelper.writeHexOctet(1);
+      GsmPDUHelper.writeHexOctet(response.resultCode);
+    }
 
     // Item Identifier
     if (response.itemIdentifier != null) {
       GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_ITEM_ID |
                                  COMPREHENSIONTLV_FLAG_CR);
       GsmPDUHelper.writeHexOctet(1);
       GsmPDUHelper.writeHexOctet(response.itemIdentifier);
     }
--- a/dom/webidl/MozIccManager.webidl
+++ b/dom/webidl/MozIccManager.webidl
@@ -145,16 +145,30 @@ interface MozIccManager : EventTarget
    * USIM, permanent problem.
    */
   const unsigned short STK_RESULT_USIM_CALL_CONTROL_PERMANENT       = 0x39;
 
   /** Bearer independent protocol error */
   const unsigned short STK_RESULT_BIP_ERROR                         = 0x3a;
 
   /**
+   * Additional information on result:
+   *
+   * TS 11.14, 12.12.1-11 and TS 31.111,8.12.1-13 defines additional infomation
+   * for different categories such as SEND SS, ME problem, network problem, etc.
+   *
+   * Note: We define these information here by category when needed.
+   */
+
+  /**
+   * 12.12.2 Additional information for ME problem:
+   */
+  const unsigned short STK_ADDITIONAL_INFO_ME_PROBLEM_SCREEN_IS_BUSY = 0x01;
+
+  /**
    * STK event list.
    */
   const unsigned short STK_EVENT_TYPE_MT_CALL                          = 0x00;
   const unsigned short STK_EVENT_TYPE_CALL_CONNECTED                   = 0x01;
   const unsigned short STK_EVENT_TYPE_CALL_DISCONNECTED                = 0x02;
   const unsigned short STK_EVENT_TYPE_LOCATION_STATUS                  = 0x03;
   const unsigned short STK_EVENT_TYPE_USER_ACTIVITY                    = 0x04;
   const unsigned short STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE            = 0x05;
--- a/dom/webidl/MozStkCommandEvent.webidl
+++ b/dom/webidl/MozStkCommandEvent.webidl
@@ -85,31 +85,31 @@ dictionary MozStkTextMessage : MozStkIco
    *
    * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 1.
    *
    * High priority text shall be displayed on the screen immediately, except if
    * there is a conflict of priority level of alerting such as incoming calls
    * or a low battery warning. In that situation, the resolution is left to
    * the terminal. If the command is rejected in spite of the high priority,
    * the terminal shall inform the ICC with resultCode is
-   * TERMINAL_CRNTLY_UNABLE_TO_PROCESS in MozStkResponse.
+   * MozIccManager.STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS in MozStkResponse.
    *
    * true: high priority
    * false: normal priority
    */
   boolean isHighPriority;
 
   /**
    * Need to wait for user to clear message or not.
    *
    * @see TS 11.14, clause 12.6, Command Qualifier, Display Text, bit 8.
    *
    * If this attribute is true, but user doesn't give any input within a period
    * of time(said 30 secs), the terminal shall inform the ICC with resultCode
-   * is NO_RESPONSE_FROM_USER in MozStkResponse.
+   * is MozIccManager.STK_RESULT_NO_RESPONSE_FROM_USER in MozStkResponse.
    *
    * true: Wait for user to clear message.
    * false: clear message after a delay.
    */
   boolean userClear;
 
   /**
    * Need to response immediately or not.
@@ -146,17 +146,17 @@ dictionary MozStkMenu : MozStkIconContai
   /**
    * Array of MozStkItem.
    *
    * @see TS 11.14, clause 12.9
    */
   sequence<MozStkItem> items;
 
   /**
-   * Presentation type, one of TYPE_*.
+   * Presentation type, one of MozIccManager.STK_MENU_TYPE_*.
    */
   unsigned short presentationType;
 
   /**
    * Title of the menu.
    */
   DOMString title;
 
@@ -172,20 +172,20 @@ dictionary MozStkMenu : MozStkIconContai
    *
    * true: help information available.
    * false: no help information available.
    */
   boolean isHelpAvailable;
 
   /**
    * List of Next Action Indicators.
-   * Each element should be one of nsIDOMMozIccManager.STK_CMD_*
-   *                            or nsIDOMMozIccManager.STK_NEXT_ACTION_*
-   * If it's STK_NEXT_ACTION_NULL, the terminal should ignore this action
-   * in corresponding item.
+   * Each element should be one of MozIccManager.STK_CMD_*
+   *                            or MozIccManager.STK_NEXT_ACTION_*
+   * If it's MozIccManager.STK_NEXT_ACTION_NULL, the terminal should ignore this
+   * action in corresponding item.
    *
    * @see TS 11.14, clause 12.24, Items Next Action Indicator.
    */
   sequence<unsigned short> nextActionList;
 };
 
 dictionary MozStkInput : MozStkIconContainer
 {
@@ -288,19 +288,17 @@ dictionary MozStkBrowserSetting
   MozStkTextMessage confirmMessage;
 
   /**
    * The URL to be opened by browser.
    */
   DOMString url;
 
   /**
-   * One of STK_BROWSER_MODE_*.
-   *
-   * @see nsIDOMMozIccManager.STK_BROWSER_MODE_*
+   * One of MozIccManager.STK_BROWSER_MODE_*.
    */
   unsigned short mode;
 };
 
 dictionary MozStkSetUpCall
 {
   /**
    * The Dialling number.
@@ -327,17 +325,17 @@ dictionary MozStkSetUpCall
 
 dictionary MozStkSetUpEventList
 {
   /**
    * The list of events that needs to provide details to ICC when they happen.
    * When this valus is null, means an indication to remove the existing list
    * of events in ME.
    *
-   * @see nsIDOMMozIccManager.STK_EVENT_TYPE_*
+   * @see MozIccManager.STK_EVENT_TYPE_*
    */
    sequence<unsigned short> eventList;
 };
 
 dictionary MozStkLocationInfo
 {
   /**
    * Mobile Country Code (MCC) of the current serving operator.
@@ -358,17 +356,17 @@ dictionary MozStkLocationInfo
    * Mobile Cell ID for the current serving operator.
    */
   unsigned long gsmCellId;
 };
 
 dictionary MozStkDuration
 {
   /**
-   * Time unit used, should be one of STK_TIME_UNIT_*.
+   * Time unit used, should be one of MozIccManager.STK_TIME_UNIT_*.
    */
   unsigned short timeUnit;
 
   /**
    * The length of time required, expressed in timeUnit.
    */
   octet timeInterval;
 };
@@ -376,17 +374,17 @@ dictionary MozStkDuration
 dictionary MozStkPlayTone : MozStkIconContainer
 {
   /**
    * Text String.
    */
   DOMString text;
 
   /**
-   * One of STK_TONE_TYPE_*.
+   * One of MozIccManager.STK_TONE_TYPE_*.
    */
   unsigned short tone;
 
   /**
    * The length of time for which the ME shall generate the tone.
    */
   MozStkDuration duration;
 
@@ -398,45 +396,45 @@ dictionary MozStkPlayTone : MozStkIconCo
   boolean isVibrate;
 };
 
 dictionary MozStkProvideLocalInfo
 {
   /**
    * Indicate which local information is required.
    * It shall be one of following:
-   *  - nsIDOMMozIccManager.STK_LOCAL_INFO_LOCATION_INFO
-   *  - nsIDOMMozIccManager.STK_LOCAL_INFO_IMEI
-   *  - nsIDOMMozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE
-   *  - nsIDOMMozIccManager.STK_LOCAL_INFO_LANGUAGE
+   *  - MozIccManager.STK_LOCAL_INFO_LOCATION_INFO
+   *  - MozIccManager.STK_LOCAL_INFO_IMEI
+   *  - MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE
+   *  - MozIccManager.STK_LOCAL_INFO_LANGUAGE
    */
   unsigned short localInfoType;
 };
 
 dictionary MozStkLocationEvent
 {
   /**
    * The type of this event.
-   * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LOCATION_STATUS;
+   * It shall be MozIccManager.STK_EVENT_TYPE_LOCATION_STATUS;
    */
   unsigned short eventType;
 
   /**
    * Indicate current service state of the MS with one of the values listed
    * below:
-   *  - nsIDOMMozIccManager.STK_SERVICE_STATE_NORMAL
-   *  - nsIDOMMozIccManager.STK_SERVICE_STATE_LIMITED
-   *  - nsIDOMMozIccManager.STK_SERVICE_STATE_UNAVAILABLE
+   *  - MozIccManager.STK_SERVICE_STATE_NORMAL
+   *  - MozIccManager.STK_SERVICE_STATE_LIMITED
+   *  - MozIccManager.STK_SERVICE_STATE_UNAVAILABLE
    */
   unsigned short locationStatus;
 
   /**
    * See MozStkLocationInfo.
    * This value shall only be provided if the locationStatus indicates
-   * 'STK_SERVICE_STATE_NORMAL'.
+   * MozIccManager.STK_SERVICE_STATE_NORMAL.
    */
   MozStkLocationInfo locationInfo;
 };
 
 dictionary MozStkTimer
 {
   /**
    * Identifier of a timer.
@@ -447,19 +445,19 @@ dictionary MozStkTimer
    * Length of time during which the timer has to run.
    * The resolution of a timer is 1 second.
    */
   unsigned long timerValue;
 
   /**
    * The action requested from UICC.
    * It shall be one of below:
-   * - nsIDOMMozIccManager.STK_TIMER_START
-   * - nsIDOMMozIccManager.STK_TIMER_DEACTIVATE
-   * - nsIDOMMozIccManager.STK_TIMER_GET_CURRENT_VALUE
+   * - MozIccManager.STK_TIMER_START
+   * - MozIccManager.STK_TIMER_DEACTIVATE
+   * - MozIccManager.STK_TIMER_GET_CURRENT_VALUE
    */
   unsigned short timerAction;
 };
 
 dictionary MozStkBipMessage : MozStkIconContainer
 {
   /**
    * Text String
@@ -473,98 +471,103 @@ dictionary MozStkCommand
    * The number of command issued by ICC. And it is assigned
    * by ICC may take any hexadecimal value betweean '01' and 'FE'.
    *
    * @see TS 11.14, clause 6.5.1
    */
   unsigned short commandNumber;
 
   /**
-   * One of STK_CMD_*
+   * One of MozIccManager.STK_CMD_*
    */
   unsigned short typeOfCommand;
 
   /**
    * Qualifiers specific to the command.
    */
   unsigned short commandQualifier;
 
   /**
    * options varies accrording to the typeOfCommand in MozStkCommand.
    *
    * When typeOfCommand is
-   * - STK_CMD_DISPLAY_TEXT
-   * - STK_CMD_SET_UP_IDLE_MODE_TEXT
-   * - STK_CMD_SEND_{SS|USSD|SMS|DTMF},
+   * - MozIccManager.STK_CMD_DISPLAY_TEXT
+   * - MozIccManager.STK_CMD_SET_UP_IDLE_MODE_TEXT
+   * - MozIccManager.STK_CMD_SEND_{SS|USSD|SMS|DTMF},
    * options is MozStkTextMessage.
    *
    * When typeOfCommand is
-   * - STK_CMD_SELECT_ITEM
-   * - STK_CMD_SET_UP_MENU
+   * - MozIccManager.STK_CMD_SELECT_ITEM
+   * - MozIccManager.STK_CMD_SET_UP_MENU
    * options is MozStkMenu.
    *
    * When typeOfCommand is
-   * - STK_CMD_GET_INKEY
-   * - STK_CMD_GET_INPUT,
+   * - MozIccManager.STK_CMD_GET_INKEY
+   * - MozIccManager.STK_CMD_GET_INPUT,
    * options is MozStkInput.
    *
    * When typeOfCommand is
-   * - STK_CMD_LAUNCH_BROWSER
+   * - MozIccManager.STK_CMD_LAUNCH_BROWSER
    * options is MozStkBrowserSetting.
    *
    * When typeOfCommand is
-   * - STK_CMD_SET_UP_CALL
+   * - MozIccManager.STK_CMD_SET_UP_CALL
    * options is MozStkSetUpCall.
    *
    * When typeOfCommand is
-   * - STK_CMD_SET_UP_EVENT_LIST
+   * - MozIccManager.STK_CMD_SET_UP_EVENT_LIST
    * options is MozStkSetUpEventList.
    *
    * When typeOfCommand is
-   * - STK_CMD_PLAY_TONE
+   * - MozIccManager.STK_CMD_PLAY_TONE
    * options is MozStkPlayTone.
    *
    * When typeOfCommand is
-   * - STK_CMD_POLL_INTERVAL
+   * - MozIccManager.STK_CMD_POLL_INTERVAL
    * options is MozStkDuration.
    *
    * When typeOfCommand is
-   * - STK_CMD_PROVIDE_LOCAL_INFO
+   * - MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO
    * options is MozStkProvideLocalInfo.
    *
    * When typeOfCommand is
-   * - STK_CMD_TIMER_MANAGEMENT
+   * - MozIccManager.STK_CMD_TIMER_MANAGEMENT
    * option is MozStkTimer
    *
    * When typeOfCommand is
-   * - STK_CMD_OPEN_CHANNEL
-   * - STK_CMD_CLOSE_CHANNEL
-   * - STK_CMD_SEND_DATA
-   * - STK_CMD_RECEIVE_DATA
+   * - MozIccManager.STK_CMD_OPEN_CHANNEL
+   * - MozIccManager.STK_CMD_CLOSE_CHANNEL
+   * - MozIccManager.STK_CMD_SEND_DATA
+   * - MozIccManager.STK_CMD_RECEIVE_DATA
    * options is MozStkBipMessage
    *
    * When typeOfCommand is
-   * - STK_CMD_POLL_OFF
+   * - MozIccManager.STK_CMD_POLL_OFF
    * options is null.
    *
    * When typeOfCommand is
-   * - STK_CMD_REFRESH
+   * - MozIccManager.STK_CMD_REFRESH
    * options is null.
    */
   any options;
 };
 
 dictionary MozStkResponse
 {
   /**
-   * One of RESULT_*
+   * One of MozIccManager.STK_RESULT_*
    */
   unsigned short resultCode;
 
   /**
+   * One of MozIccManager.STK_ADDITIONAL_INFO_*
+   */
+  unsigned short additionalInformation;
+
+  /**
    * The identifier of the item selected by user.
    *
    * @see MozStkItem.identifier
    */
   unsigned short itemIdentifier;
 
   /**
    * User input.
@@ -574,69 +577,72 @@ dictionary MozStkResponse
   /**
    * YES/NO response.
    *
    * @see MozStkInput.isYesNoRequested
    */
   boolean isYesNo;
 
   /**
-   * User has confirmed or rejected the call during STK_CMD_CALL_SET_UP.
+   * User has confirmed or rejected the call during
+   * MozIccManager.STK_CMD_CALL_SET_UP.
    *
    * @see RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
    *
    * true: Confirmed by User.
    * false: Rejected by User.
    */
   boolean hasConfirmed;
 
   /**
-   * The response for STK_CMD_PROVIDE_LOCAL_INFO
+   * The response for MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO
    */
   MozStkLocalInfo localInfo;
 
   /**
-   * The response for STK_CMD_TIMER_MANAGEMENT.
-   * The 'timerValue' is needed if the action of STK_CMD_TIMER_MANAGEMENT is
-   * 'STK_TIMER_DEACTIVATE' or 'STK_TIMER_GET_CURRENT_VALUE'. It shall state
-   * the current value of a timer. And the resolution is 1 second.
+   * The response for MozIccManager.STK_CMD_TIMER_MANAGEMENT.
+   * The 'timerValue' is needed if the action of
+   * MozIccManager.STK_CMD_TIMER_MANAGEMENT is MozIccManager.STK_TIMER_DEACTIVATE
+   * or MozIccManager.STK_TIMER_GET_CURRENT_VALUE.
+   * It shall state the current value of a timer. And the resolution is 1 second.
    */
   MozStkTimer timer;
 };
 
 dictionary MozStkCallEvent
 {
   /**
    * The type of this event.
    * It shall be one of following:
-   *     - nsIDOMMozIccManager.STK_EVENT_TYPE_MT_CALL,
-   *     - nsIDOMMozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
-   *     - nsIDOMMozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED.
+   *     - MozIccManager.STK_EVENT_TYPE_MT_CALL,
+   *     - MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED,
+   *     - MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED.
    */
   unsigned short eventType;
 
   /**
    * Remote party number.
    */
   DOMString number;
 
   /**
-   * This field is available in 'STK_EVENT_TYPE_CALL_CONNECTED' and
-   * 'STK_EVENT_TYPE_CALL_DISCONNECTED' events.
-   * For the STK_EVENT_TYPE_CALL_CONNECTED event, setting this to true means the
-   * connection is answered by remote end, that is, this is an outgoing call.
-   * For the STK_EVENT_TYPE_CALL_DISCONNECTED event, setting this to true
-   * indicates the connection is hung up by remote.
+   * This field is available in MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED and
+   * MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED events.
+   * For the MozIccManager.STK_EVENT_TYPE_CALL_CONNECTED event, setting this to
+   * true means the connection is answered by remote end, that is, this is an
+   * outgoing call.
+   * For the MozIccManager.STK_EVENT_TYPE_CALL_DISCONNECTED event, setting this
+   * to true indicates the connection is hung up by remote.
    */
   boolean isIssuedByRemote;
 
   /**
    * This field is available in Call Disconnected event to indicate the cause
    * of disconnection. The cause string is passed to gaia through the error
-   * listener of nsIDOMCallEvent. Null if there's no error.
+   * listener of CallEvent. Null if there's no error.
    */
   DOMString error;
 };
 
 dictionary MozStkLocalInfo
 {
   /**
    * IMEI information
@@ -660,49 +666,49 @@ dictionary MozStkLocalInfo
    */
   DOMString language;
 };
 
 dictionary MozStkLanguageSelectionEvent
 {
   /**
    * The type of this event.
-   * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION.
+   * It shall be MozIccManager.STK_EVENT_TYPE_LANGUAGE_SELECTION.
    */
   unsigned short eventType;
 
   /**
    * Language Information
    *
    * @see ISO 639-1, Alpha-2 code
    *      "de" for German, "en" for English, "zh" for Chinese, etc.
    */
   DOMString language;
 };
 
 dictionary MozStkBrowserTerminationEvent
 {
   /**
    * The type of this event.
-   * It shall be nsIDOMMozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION
+   * It shall be MozIccManager.STK_EVENT_TYPE_BROWSER_TERMINATION
    */
   unsigned short eventType;
 
   /**
    * This object shall contain the browser termination cause.
    * See TZ 102 223 8.51. It shall be one of following:
-   * - nsIDOMMozIccManager.STK_BROWSER_TERMINATION_CAUSE_USER
-   * - nsIDOMMozIccManager.STK_BROWSER_TERMINATION_CAUSE_ERROR
+   * - MozIccManager.STK_BROWSER_TERMINATION_CAUSE_USER
+   * - MozIccManager.STK_BROWSER_TERMINATION_CAUSE_ERROR
    */
   unsigned short terminationCause;
 };
 
 dictionary MozStkGeneralEvent
 {
   /**
    * The type of this event, MozStkGeneralEvent can be used for all Stk Event
    * requires no more parameter than event type, including
-   * nsIDOMMozIccManager.STK_EVENT_TYPE_USER_ACTIVITY.
-   * nsIDOMMozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE.
+   * MozIccManager.STK_EVENT_TYPE_USER_ACTIVITY.
+   * MozIccManager.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE.
    * HCI Connectivity Event(Not defined in interface yet).
    */
   unsigned short eventType;
 };