From c8da011a74a720ccf82caadf43fa8d68ab8cbef0 Mon Sep 17 00:00:00 2001 From: Yasuyoshi Terui Date: Fri, 14 Feb 2014 15:07:35 +0900 Subject: [PATCH] Add to receive BTHF_CALL_STATE_DISCONNECTED at HFP When the call is disconnected, the BTHF state is changed to IDLE and SCO connection is disconnected before playing disconnect tone. So the disconnect tone can't be sound from BTHS. Add DISCONNECTED state for HFP and keep the state until disconnect tone sounds from BT. Test: manual - Checked whether the disconnect tone is sound from the BTHS Bug: 69645337 Change-Id: Id96385e4ce35cfe7d0d4e14b74a2fc1a63165f82 --- btif/src/btif_hf.cc | 4 ++++ include/hardware/bt_hf.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/btif/src/btif_hf.cc b/btif/src/btif_hf.cc index 8b1af73ae..1f75df320 100644 --- a/btif/src/btif_hf.cc +++ b/btif/src/btif_hf.cc @@ -155,6 +155,7 @@ static const char* dump_hf_call_state(bthf_call_state_t call_state) { CASE_RETURN_STR(BTHF_CALL_STATE_INCOMING) CASE_RETURN_STR(BTHF_CALL_STATE_WAITING) CASE_RETURN_STR(BTHF_CALL_STATE_ACTIVE) + CASE_RETURN_STR(BTHF_CALL_STATE_DISCONNECTED) default: return "UNKNOWN CALL STATE"; } @@ -1201,6 +1202,9 @@ bt_status_t HeadsetInterface::PhoneStateChange( ag_res.audio_handle = btif_hf_cb[idx].handle; res = BTA_AG_OUT_CALL_ALERT_RES; break; + case BTHF_CALL_STATE_DISCONNECTED: + res = 0; + break; default: BTIF_TRACE_ERROR("%s: Incorrect new ringing call state", __func__); status = BT_STATUS_PARM_INVALID; diff --git a/include/hardware/bt_hf.h b/include/hardware/bt_hf.h index 91a4e6a57..ac2de4d2a 100644 --- a/include/hardware/bt_hf.h +++ b/include/hardware/bt_hf.h @@ -97,7 +97,8 @@ typedef enum { BTHF_CALL_STATE_ALERTING, BTHF_CALL_STATE_INCOMING, BTHF_CALL_STATE_WAITING, - BTHF_CALL_STATE_IDLE + BTHF_CALL_STATE_IDLE, + BTHF_CALL_STATE_DISCONNECTED } bthf_call_state_t; typedef enum { -- 2.11.0