From 4782b0a6fe37a94593bc3c4e399023aa423186fb Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Tue, 20 Jan 2015 18:04:01 +0800 Subject: [PATCH] Bug 1117658 - Part 1: Provide Duration TLV in TR for "USAT case 27.22.4.2.8 GET INKEY SEQ 8.1 GET INKEY". r=echen --- dom/system/gonk/ril_worker.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 388c9997c956..80be5b27e961 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -2954,7 +2954,7 @@ RilObject.prototype = { GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_COMMAND_DETAILS | COMPREHENSIONTLV_FLAG_CR); GsmPDUHelper.writeHexOctet(3); - if (response.command) { + if (command) { GsmPDUHelper.writeHexOctet(command.commandNumber); GsmPDUHelper.writeHexOctet(command.typeOfCommand); GsmPDUHelper.writeHexOctet(command.commandQualifier); @@ -3035,6 +3035,24 @@ RilObject.prototype = { } } + // Duration + if (response.resultCode === STK_RESULT_NO_RESPONSE_FROM_USER) { + // In TS102 223, 6.4.2 GET INKEY, "if the UICC requests a variable timeout, + // the terminal shall wait until either the user enters a single character + // or the timeout expires. The timer starts when the text is displayed on + // the screen and stops when the TERMINAL RESPONSE is sent. The terminal + // shall pass the total display text duration (command execution duration) + // to the UICC using the TERMINAL RESPONSE. The time unit of the response + // is identical to the time unit of the requested variable timeout." + let duration = command && command.options && command.options.duration; + if (duration) { + GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_DURATION); + GsmPDUHelper.writeHexOctet(2); + GsmPDUHelper.writeHexOctet(duration.timeUnit); + GsmPDUHelper.writeHexOctet(duration.timeInterval); + } + } + // Local Information if (response.localInfo) { let localInfo = response.localInfo;