From b80198b2b1af356b9c0ad3eaa8f5b9c3a074cd30 Mon Sep 17 00:00:00 2001 From: Georgia Wang Date: Wed, 23 Oct 2013 10:30:10 +0800 Subject: [PATCH] Bug 908535 - Part2: Process STK OPEN CHANNEL cmd and ctlvs in ril. r=yoshi --- dom/system/gonk/ril_consts.js | 16 +++++++++++++++- dom/system/gonk/ril_worker.js | 23 +++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index 9a3ffef5a1d3..c8ea3a044d67 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -750,6 +750,7 @@ this.STK_CMD_SEND_USSD = 0x12; this.STK_CMD_SEND_SMS = 0x13; this.STK_CMD_SEND_DTMF = 0x14; this.STK_CMD_LAUNCH_BROWSER = 0x15; +this.STK_CMD_OPEN_CHANNEL = 0x16; this.STK_CMD_PLAY_TONE = 0x20; this.STK_CMD_DISPLAY_TEXT = 0x21; this.STK_CMD_GET_INKEY = 0x22; @@ -1043,6 +1044,12 @@ this.STK_TERMINAL_SUPPORT_PROACTIVE_LANGUAGE_NOTIFICATION = 0; this.STK_TERMINAL_SUPPORT_PROACTIVE_LAUNCH_BROWSER = 1; this.STK_TERMINAL_SUPPORT_PROACTIVE_LOCAL_INFO_ACCESS_TECH = 0; +this.STK_TERMINAL_SUPPORT_BIP_COMMAND_OPEN_CHANNEL = 1; +this.STK_TERMINAL_SUPPORT_BIP_COMMAND_CLOSE_CHANNEL = 0; +this.STK_TERMINAL_SUPPORT_BIP_COMMAND_RECEIVE_DATA = 0; +this.STK_TERMINAL_SUPPORT_BIP_COMMAND_SEND_DATA = 0; +this.STK_TERMINAL_SUPPORT_BIP_COMMAND_GET_CHANNEL_STATUS = 0; + /** * SAT profile * @@ -1124,6 +1131,13 @@ this.STK_TERMINAL_PROFILE_PROACTIVE_4 = (STK_TERMINAL_SUPPORT_PROACTIVE_LAUNCH_BROWSER << 6) | (STK_TERMINAL_SUPPORT_PROACTIVE_LOCAL_INFO_ACCESS_TECH << 7); +this.STK_TERMINAL_PROFILE_BIP_COMMAND = + (STK_TERMINAL_SUPPORT_BIP_COMMAND_OPEN_CHANNEL << 0) | + (STK_TERMINAL_SUPPORT_BIP_COMMAND_CLOSE_CHANNEL << 1) | + (STK_TERMINAL_SUPPORT_BIP_COMMAND_RECEIVE_DATA << 2) | + (STK_TERMINAL_SUPPORT_BIP_COMMAND_SEND_DATA << 3) | + (STK_TERMINAL_SUPPORT_BIP_COMMAND_GET_CHANNEL_STATUS << 4); + this.STK_SUPPORTED_TERMINAL_PROFILE = [ STK_TERMINAL_PROFILE_DOWNLOAD, STK_TERMINAL_PROFILE_OTHER, @@ -1136,7 +1150,7 @@ this.STK_SUPPORTED_TERMINAL_PROFILE = [ STK_TERMINAL_PROFILE_PROACTIVE_4, 0x00, // Softkey support 0x00, // Softkey information - 0x00, // BIP proactive commands + STK_TERMINAL_PROFILE_BIP_COMMAND, 0x00, // BIP supported bearers 0x00, // Screen height 0x00, // Screen width diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index e4832de3e1df..b3dfe3212d7f 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -9900,6 +9900,26 @@ let StkCommandParamsFactory = { } return timer; + }, + + /** + * Construct a param for BIP commands. + * + * @param cmdDetails + * The value object of CommandDetails TLV. + * @param ctlvs + * The all TLVs in this proactive command. + */ + processBipMessage: function processBipMessage(cmdDetails, ctlvs) { + let bipMsg = {}; + + let ctlv = StkProactiveCmdHelper.searchForTag( + COMPREHENSIONTLV_TAG_ALPHA_ID, ctlvs); + if (ctlv) { + bipMsg.text = ctlv.value.identifier; + } + + return bipMsg; } }; StkCommandParamsFactory[STK_CMD_REFRESH] = function STK_CMD_REFRESH(cmdDetails, ctlvs) { @@ -9959,6 +9979,9 @@ StkCommandParamsFactory[STK_CMD_PLAY_TONE] = function STK_CMD_PLAY_TONE(cmdDetai StkCommandParamsFactory[STK_CMD_TIMER_MANAGEMENT] = function STK_CMD_TIMER_MANAGEMENT(cmdDetails, ctlvs) { return this.processTimerManagement(cmdDetails, ctlvs); }; +StkCommandParamsFactory[STK_CMD_OPEN_CHANNEL] = function STK_CMD_OPEN_CHANNEL(cmdDetails, ctlvs) { + return this.processBipMessage(cmdDetails, ctlvs); +}; let StkProactiveCmdHelper = { retrieve: function retrieve(tag, length) {