summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorc_sdamga <sudharma@codeaurora.org>2015-07-20 19:17:04 +0530
committerJack He <siyuanh@google.com>2017-10-05 02:35:31 -0700
commitab6fcc863ec741378192a81dbb4e12219ba9e493 (patch)
tree8654776a41bf1765bc5593a21e5b553863d12368
parent5f984c9fa3d58ccbbb3a2431f8c476b23eba1fca (diff)
downloadandroid_system_bt-ab6fcc863ec741378192a81dbb4e12219ba9e493.tar.gz
android_system_bt-ab6fcc863ec741378192a81dbb4e12219ba9e493.tar.bz2
android_system_bt-ab6fcc863ec741378192a81dbb4e12219ba9e493.zip
Handle Disconnect request in AV Opening State handler
Usecase: 1. Uncheck media from settings UI 2. initiate A2dp connection from remote, send AVRCP play from remote Failure: A2dp connection stuck in opening state. Rootcause: When A2dp is unchecked from settings UI and remote initiated a2dp connection and AVRCP play, music starts streaming on DUT since A2dp connection disconnected. As A2dp connection was not completed, btif state stuck in opening state. Fix: Handled the disconnection request in the opening state so that AV state machine moves to proper state before processing AVRCP Play. Test: 1. Uncheck media from settings UI 2. initiate A2dp connection from remote, send AVRCP play Bug: 35415160 Change-Id: If1cda5b78100419fdc60c97349efafdd4a18d40c (cherry picked from commit ff1b9d26ca9a5a25d45bab09df1c0346104051a9)
-rw-r--r--btif/src/btif_av.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/btif/src/btif_av.cc b/btif/src/btif_av.cc
index b7f1ac935..2317674d3 100644
--- a/btif/src/btif_av.cc
+++ b/btif/src/btif_av.cc
@@ -652,6 +652,14 @@ static bool btif_av_state_opening_handler(btif_sm_event_t event, void* p_data) {
btif_sm_change_state(btif_av_cb.sm_handle, BTIF_AV_STATE_IDLE);
break;
+ case BTIF_AV_DISCONNECT_REQ_EVT:
+ btif_report_connection_state(BTAV_CONNECTION_STATE_DISCONNECTED,
+ &(btif_av_cb.peer_bda));
+ BTA_AvClose(btif_av_cb.bta_handle);
+ btif_queue_advance();
+ btif_sm_change_state(btif_av_cb.sm_handle, BTIF_AV_STATE_IDLE);
+ break;
+
CHECK_RC_EVENT(event, (tBTA_AV*)p_data);
default: