From: Wootak Jung Date: Mon, 16 Mar 2020 03:39:31 +0000 (+0900) Subject: Fix wrong av disconnected event sending issue X-Git-Tag: submit/tizen/20200323.004911^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F228406%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix wrong av disconnected event sending issue Change-Id: I6606d9814262c2f98ee5accf08b3cd84e17aeb2c --- diff --git a/bt-service-adaptation/services/audio/a2dp_src/bt-service-a2dp-src.c b/bt-service-adaptation/services/audio/a2dp_src/bt-service-a2dp-src.c index caf7515..51d15b1 100644 --- a/bt-service-adaptation/services/audio/a2dp_src/bt-service-a2dp-src.c +++ b/bt-service-adaptation/services/audio/a2dp_src/bt-service-a2dp-src.c @@ -185,10 +185,6 @@ static void __bt_handle_av_disconnected_state(bluetooth_device_address_t *addres /* Set VCONF status for A2DP Disconnection */ _bt_set_device_values(FALSE, VCONFKEY_BT_DEVICE_A2DP_HEADSET_CONNECTED); - /* Send A2DP(SRC Role) disconnected event to Application */ - param = g_variant_new("(is)", result, addr); - _bt_send_event(BT_HEADSET_EVENT, BLUETOOTH_EVENT_AV_DISCONNECTED, param); - /* Remove data from the connected list */ _bt_remove_headset_from_list(BT_AUDIO_A2DP, addr); @@ -211,6 +207,10 @@ static void __bt_handle_av_disconnected_state(bluetooth_device_address_t *addres if (req_info == NULL) { BT_INFO("Audio Connect All request is also Not found.."); + /* Send A2DP(SRC Role) disconnected event to Application */ + param = g_variant_new("(is)", result, addr); + _bt_send_event(BT_HEADSET_EVENT, BLUETOOTH_EVENT_AV_DISCONNECTED, param); + req_info = _bt_get_request_info_data(BT_AUDIO_DISCONNECT, addr); if (req_info == NULL) { BT_INFO("Audio DisConnect All request is also Not found.."); @@ -253,6 +253,9 @@ static void __bt_handle_av_disconnected_state(bluetooth_device_address_t *addres } } else { BT_ERR("AV Disconnect request found for [%s], means disconnect request is successful", addr); /* DBUS return needed */ + /* Send A2DP(SRC Role) disconnected event to Application */ + param = g_variant_new("(is)", result, addr); + _bt_send_event(BT_HEADSET_EVENT, BLUETOOTH_EVENT_AV_DISCONNECTED, param); goto check_wait_device; } check_wait_device: