Bug 908083 - Part2:"browser termination event" Envelope command implement. r=yoshi
authorGeorgia Wang <gwang@mozilla.com>
Tue, 03 Sep 2013 17:50:18 +0800
changeset 166350 f5dbf24ff1f203c1ae8e184dea6c0b8aea33ea92
parent 166349 c44d0a4ab9440646adcbd6cb9273ad424f8e388b
child 166351 dcab3b214724f662f0dd9b005a607ca6f60cbe0e
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyoshi
bugs908083
milestone27.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 908083 - Part2:"browser termination event" Envelope command implement. r=yoshi
dom/system/gonk/ril_consts.js
dom/system/gonk/ril_worker.js
--- a/dom/system/gonk/ril_consts.js
+++ b/dom/system/gonk/ril_consts.js
@@ -707,16 +707,17 @@ this.COMPREHENSIONTLV_TAG_EVENT_LIST = 0
 this.COMPREHENSIONTLV_TAG_ICON_ID = 0x1e;
 this.COMPREHENSIONTLV_TAG_ICON_ID_LIST = 0x1f;
 this.COMPREHENSIONTLV_TAG_TIMER_IDENTIFIER = 0x24;
 this.COMPREHENSIONTLV_TAG_TIMER_VALUE = 0x25;
 this.COMPREHENSIONTLV_TAG_DATE_TIME_ZONE = 0x26;
 this.COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE = 0x2b;
 this.COMPREHENSIONTLV_TAG_LANGUAGE = 0x2d;
 this.COMPREHENSIONTLV_TAG_URL = 0x31;
+this.COMPREHENSIONTLV_TAG_BROWSER_TERMINATION_CAUSE = 0x34;
 this.COMPREHENSIONTLV_TAG_ACCESS_TECH = 0x3f;
 this.COMPREHENSIONTLV_TAG_SERVICE_RECORD = 0x41;
 this.COMPREHENSIONTLV_TAG_IMEISV = 0x62;
 this.COMPREHENSIONTLV_TAG_BATTERY_STATE = 0x63;
 this.COMPREHENSIONTLV_TAG_NETWORK_SEARCH_MODE = 0x65;
 this.COMPREHENSIONTLV_TAG_MEID = 0x6d;
 this.COMPREHENSIONTLV_TAG_BROADCAST_NETWORK_INFO = 0x7a;
 
@@ -959,16 +960,20 @@ this.STK_LOCAL_INFO_MULTIPLE_ACCESS_TECH
 this.STK_LOCAL_INFO_INFO_FOR_MULTIPLE_ACCESS_TECH = 0x0F;
 this.STK_LOCAL_INFO_NMR_FOR_MULTIPLE_ACCESS_TECH = 0x10;
 
 // Timer Management.
 this.STK_TIMER_START = 0x00;
 this.STK_TIMER_DEACTIVATE = 0x01;
 this.STK_TMIER_GET_CURRENT_VALUE = 0x02;
 
+// Browser Termination Cause.
+this.STK_BROWSER_TERMINATION_CAUSE_USER = 0x00;
+this.STK_BROWSER_TERMINATION_CAUSE_ERROR = 0x01;
+
 /**
  * Supported Terminal Facilities.
  *
  * value = 1, supported.
  *         0, not supported.
  */
 this.STK_TERMINAL_SUPPORT_PROFILE_DOWNLOAD             = 1;
 this.STK_TERMINAL_SUPPORT_SMS_PP_DOWNLOAD              = 1;
@@ -1011,17 +1016,17 @@ this.STK_TERMINAL_SUPPORT_EVENT_MT_CALL 
 this.STK_TERMINAL_SUPPORT_EVENT_CALL_CONNECTED         = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_CALL_DISCONNECTED      = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_LOCATION_STATUS        = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_USER_ACTIVITY          = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_IDLE_SCREEN_AVAILABLE  = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_CARD_READER_STATUS     = 0;
 
 this.STK_TERMINAL_SUPPORT_EVENT_LANGUAGE_SELECTION     = 1;
-this.STK_TERMINAL_SUPPORT_EVENT_BROWSER_TERMINATION    = 0;
+this.STK_TERMINAL_SUPPORT_EVENT_BROWSER_TERMINATION    = 1;
 this.STK_TERMINAL_SUPPORT_EVENT_DATA_AVAILABLE         = 0;
 this.STK_TERMINAL_SUPPORT_EVENT_CHANNEL_STATUS         = 0;
 
 this.STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_START_STOP   = 1;
 this.STK_TERMINAL_SUPPORT_PROACTIVE_TIMER_GET_CURRENT  = 1;
 this.STK_TERMINAL_SUPPORT_PROACTIVE_LOCAL_INFO_DATE    = 1;
 this.STK_TERMINAL_SUPPORT_GET_INKEY                    = 1;
 this.STK_TERMINAL_SUPPORT_SET_UP_IDLE_MODE_TEXT        = 1;
--- a/dom/system/gonk/ril_worker.js
+++ b/dom/system/gonk/ril_worker.js
@@ -2722,16 +2722,23 @@ let RIL = {
         break;
       case STK_EVENT_TYPE_LANGUAGE_SELECTION:
         command.deviceId = {
           sourceId: STK_DEVICE_ID_ME,
           destinationId: STK_DEVICE_ID_SIM
         };
         command.language = command.event.language;
         break;
+      case STK_EVENT_TYPE_BROWSER_TERMINATION:
+        command.deviceId = {
+          sourceId: STK_DEVICE_ID_ME,
+          destinationId: STK_DEVICE_ID_SIM
+        };
+        command.terminationCause = command.event.terminationCause;
+        break;
     }
     this.sendICCEnvelopeCommand(command);
   },
 
   /**
    * Send REQUEST_STK_SEND_ENVELOPE_COMMAND to ICC.
    *
    * @param tag
@@ -2741,16 +2748,17 @@ let RIL = {
    * @param [optional] eventList
    * @param [optional] locationStatus
    * @param [optional] locationInfo
    * @param [optional] address
    * @param [optional] transactionId
    * @param [optional] cause
    * @param [optional] timerId
    * @param [optional] timerValue
+   * @param [optional] terminationCause
    */
   sendICCEnvelopeCommand: function sendICCEnvelopeCommand(options) {
     if (DEBUG) {
       debug("Stk Envelope " + JSON.stringify(options));
     }
     Buf.newParcel(REQUEST_STK_SEND_ENVELOPE_COMMAND);
 
     // 1st mark for Parcel size
@@ -2848,16 +2856,24 @@ let RIL = {
         ComprehensionTlvHelper.writeTimerValueTlv(options.timerValue, true);
     }
 
     // Language
     if (options.language) {
       ComprehensionTlvHelper.writeLanguageTlv(options.language);
     }
 
+    // Browser Termination
+    if (options.terminationCause != null) {
+      GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_BROWSER_TERMINATION_CAUSE |
+                                 COMPREHENSIONTLV_FLAG_CR);
+      GsmPDUHelper.writeHexOctet(1);
+      GsmPDUHelper.writeHexOctet(options.terminationCause);
+    }
+
     // Calculate and write BER length to 2nd mark
     Buf.stopCalOutgoingSize();
 
     // Calculate and write Parcel size to 1st mark
     Buf.stopCalOutgoingSize();
 
     Buf.writeInt32(0);
     Buf.sendParcel();