summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpenghua <quic_penghua@quicinc.com>2023-04-10 16:42:01 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2023-04-12 01:11:30 -0700
commit17d4ccf2e9f74cb67803998c5d578f004c00845e (patch)
treeadf7758eb156d497d2fa8146e8beaf6154a9fe04
parentf20503c97e19542e15f2e94b0d4fc21fed70dfa1 (diff)
Return FAILURE if A2DP active device change is failed
BT stack returns TRUE in the API of set_active_device if A2DP is disconnected during the process of A2DP SHO. It causes MM audio start streaming , but failed. The fix is to return FAILURE if A2DP active device change is failed. Change-Id: I1427f716b4437e8e18f5afaaec1e77ca59529bb7 CRs-Fixed: 3459418
-rw-r--r--btif/src/btif_av.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/btif/src/btif_av.cc b/btif/src/btif_av.cc
index 2eadc236c..f6b0020ec 100644
--- a/btif/src/btif_av.cc
+++ b/btif/src/btif_av.cc
@@ -4876,7 +4876,12 @@ static bt_status_t set_active_device(const RawAddress& bd_addr) {
if (!bd_addr.IsEmpty())
btif_transfer_context(btif_av_handle_event, BTIF_AV_CHECK_PENDING_PLAY_EVT,
(char *)&bd_addr, sizeof(RawAddress), NULL);
- return BT_STATUS_SUCCESS;
+ BTIF_TRACE_EVENT("%s: session_wait: %d",__func__, session_wait);
+ if (session_wait) {
+ return BT_STATUS_SUCCESS;
+ } else {
+ return BT_STATUS_FAIL;
+ }
} else {
/* Initiate handoff for the device with address in the argument*/
return btif_transfer_context(btif_av_handle_event,