Audio connect issue if 2 Headset already connected 24/139524/1
authorBiman Paul <biman.paul@samsung.com>
Wed, 19 Jul 2017 06:43:14 +0000 (12:13 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Wed, 19 Jul 2017 08:28:27 +0000 (13:58 +0530)
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
bt-service/bt-service-event-receiver.c

index 68994b4..c889216 100644 (file)
@@ -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);
 
index 29534d1..4a75398 100644 (file)
@@ -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,