hal: Fix audio leak issue on speaker during A2DP and SCO concurrency.
-To ensure that A2DP stream is suspended before SCO starts, force
route to speaker is done, update the logic to ensure that force
routing to speaker only happens when there is no A2DP device active.
-Ensure that a2dp_start retry happens on routing request if the earlier
start failed.
Change-Id: I29ea0d8857fc4b9d837f9954423861be9b43b9a6
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index d0959e8..4ac94ca 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -788,7 +788,9 @@
bool audio_extn_a2dp_is_force_device_switch()
{
//During encoder reconfiguration mode, force a2dp device switch
- return a2dp.is_handoff_in_progress;
+ // Or if a2dp device is selected but earlier start failed ( as a2dp
+ // was suspended, force retry.
+ return a2dp.is_handoff_in_progress || !a2dp.a2dp_started;
}
void audio_extn_a2dp_get_apptype_params(uint32_t *sample_rate,