From c2f8a632e3d6d17cbb252873b60301cace5b38a5 Mon Sep 17 00:00:00 2001 From: Biman Paul Date: Wed, 19 Jul 2017 12:13:14 +0530 Subject: [PATCH] Audio connect issue if 2 Headset already connected Unable to connect to 3rd headset if already connected to 2 headsets (with one over HFP and other over A2DP) Global variable which contains the connection request is getting freed So free the global data when none of device is connected. Change-Id: Ie01c72e0560183477a3f06455a765153f2f085ad --- bt-service/bt-service-audio.c | 4 +++- bt-service/bt-service-event-receiver.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bt-service/bt-service-audio.c b/bt-service/bt-service-audio.c index 68994b4..c889216 100644 --- a/bt-service/bt-service-audio.c +++ b/bt-service/bt-service-audio.c @@ -451,8 +451,10 @@ static int __bt_is_headset_connected(int type, int req_id, node = g_list_next(node); } - if (!connected) + if (!connected) { + __bt_free_wait_data(); return BLUETOOTH_ERROR_NOT_CONNECTED; + } BT_DBG("connected headset %s", connected_address); diff --git a/bt-service/bt-service-event-receiver.c b/bt-service/bt-service-event-receiver.c index 29534d1..4a75398 100644 --- a/bt-service/bt-service-event-receiver.c +++ b/bt-service/bt-service-event-receiver.c @@ -2469,7 +2469,6 @@ void _bt_handle_headset_event(GVariant *msg, const char *path) wait_list->address); _bt_audio_connect(wait_list->req_id, wait_list->type, &device_address, NULL); - _bt_rel_wait_data(); } else if (event == BLUETOOTH_EVENT_AG_CONNECTED) { /* Add data to the connected list */ _bt_add_headset_to_list(BT_AUDIO_HSP, -- 2.7.4