From b9e76d4e3fc03e8c2399f8187e9d29d1b9c0f580 Mon Sep 17 00:00:00 2001 From: Hsinyi Tsai Date: Wed, 20 Jun 2012 18:52:51 +0800 Subject: [PATCH] Bug 766273 - B2G telephony on Otoro: Can't hang up dialing call. r=philikon --- dom/system/gonk/ril_worker.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 25a270d17429..ac041706bbde 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -1530,8 +1530,22 @@ let RIL = { */ hangUp: function hangUp(options) { let call = this.currentCalls[options.callIndex]; - if (call && call.state != CALL_STATE_HOLDING) { - Buf.simpleRequest(REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND); + if (!call) { + return; + } + + switch (call.state) { + case CALL_STATE_ACTIVE: + case CALL_STATE_DIALING: + case CALL_STATE_ALERTING: + Buf.newParcel(REQUEST_HANGUP); + Buf.writeUint32(1); + Buf.writeUint32(options.callIndex); + Buf.sendParcel(); + break; + case CALL_STATE_HOLDING: + Buf.simpleRequest(REQUEST_HANGUP_WAITING_OR_BACKGROUND); + break; } },