From: Ganesh Ganapathi Batta Date: Mon, 28 Apr 2014 23:25:52 +0000 (-0700) Subject: Fix issue of HDP select thread not exiting during BT OFF X-Git-Tag: android-x86-7.1-r1~1802 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f7083df9c30849fabfb2d03ce95701f110a2df99;p=android-x86%2Fsystem-bt.git Fix issue of HDP select thread not exiting during BT OFF Change-Id: I52a0a3caff327a7a51e293c431ddbc99db690180 --- diff --git a/btif/src/btif_hl.c b/btif/src/btif_hl.c index e80a0b94b..cdf13b681 100644 --- a/btif/src/btif_hl.c +++ b/btif/src/btif_hl.c @@ -5056,10 +5056,14 @@ static inline int btif_hl_close_select_thread(void) char sig_on = btif_hl_signal_select_exit; BTIF_TRACE_DEBUG0("btif_hl_signal_select_exit"); result = send(signal_fds[1], &sig_on, sizeof(sig_on), 0); - /* Wait for the select_thread_id to exit */ - if (select_thread_id != -1) { - pthread_join(select_thread_id, NULL); - select_thread_id = -1; + if (btif_is_enabled()) + { + /* Wait for the select_thread_id to exit if BT is still enabled + and only this profile getting cleaned up*/ + if (select_thread_id != -1) { + pthread_join(select_thread_id, NULL); + select_thread_id = -1; + } } /* Cleanup signal sockets */ if(signal_fds[0] != -1)