From: Sangki Park Date: Wed, 8 Apr 2020 10:36:02 +0000 (+0900) Subject: Fix : connection replace failure X-Git-Tag: accepted/tizen/unified/20200414.135759~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F230237%2F1;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Fix : connection replace failure [Model] ALL [BinType] AP [Customer] ALL [Issue#] PLM [Request] N/A [Occurrence Version] N/A [Problem] connection replace failure [Cause & Measure] Fixed [Checking Method] (Pre-condition) Connect HFP and A2DP with Headset_A - try to connect to Headset_B - expected : HFP and A2DP should be connected with Headset_B - problem : HFP connection with Headset_B , A2DP connection with Headset_A [Team] Bluetooth [Developer] Sangki Park [Solution company] Samsung [Change Type] Specification change Change-Id: I5f16c67428dce8b68fd960f85e64456ae3e90d8a --- diff --git a/bt-service-adaptation/services/audio/bt-service-audio.c b/bt-service-adaptation/services/audio/bt-service-audio.c index 8662999..49a59c3 100644 --- a/bt-service-adaptation/services/audio/bt-service-audio.c +++ b/bt-service-adaptation/services/audio/bt-service-audio.c @@ -865,12 +865,20 @@ int __bt_handle_audio_all_connect(bt_pending_audio_conn_t *info) } } else if (ret == BLUETOOTH_ERROR_NONE) { BT_INFO("Waiting for disconnection..."); - /* - * It means, we dont need pending connect info as only A2DP (Src/Snk) or - * HFP will be connected for present device, so lets free pending info. - */ - g_free(info->address); - g_free(info); + + if ((info->is_hfp_supported && info->is_a2dp_sink_supported) || + (info->is_hfp_supported && info->is_a2dp_src_supported)) { + BT_INFO("[%s] Supports HFP and (A2DP_Src or, A2DP_Snk)", info->address); + pending_audio_conn_list = g_slist_append(pending_audio_conn_list, (gpointer)info); + } else { + BT_INFO("[%s] Supports one profile only", info->address); + /* + * It means, we dont need pending connect info as only A2DP (Src/Snk) or + * HFP will be connected for present device, so lets free pending info. + */ + g_free(info->address); + g_free(info); + } } BT_DBG("-");