hal: fix music playback mute issues for a2dp suspended scenarios
Music may not be resumed after A2DP resumed due to improper mute
applied and not restored.
CRs-Fixed: 2088539
Change-Id: I3a222f128659de603504f6bed4d4e3cdcc7a125b
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c
index b96a147..548bb7c 100644
--- a/hal/audio_extn/a2dp.c
+++ b/hal/audio_extn/a2dp.c
@@ -805,7 +805,8 @@
a2dp.a2dp_suspended = true;
list_for_each(node, &a2dp.adev->usecase_list) {
uc_info = node_to_item(node, struct audio_usecase, list);
- if (uc_info->type == PCM_PLAYBACK) {
+ if (uc_info->type == PCM_PLAYBACK &&
+ (uc_info->stream.out->devices & AUDIO_DEVICE_OUT_ALL_A2DP)) {
pthread_mutex_unlock(&a2dp.adev->lock);
check_a2dp_restore(a2dp.adev, uc_info->stream.out, false);
pthread_mutex_lock(&a2dp.adev->lock);
@@ -844,7 +845,8 @@
}
list_for_each(node, &a2dp.adev->usecase_list) {
uc_info = node_to_item(node, struct audio_usecase, list);
- if (uc_info->type == PCM_PLAYBACK) {
+ if (uc_info->type == PCM_PLAYBACK &&
+ (uc_info->stream.out->devices & AUDIO_DEVICE_OUT_ALL_A2DP)) {
pthread_mutex_unlock(&a2dp.adev->lock);
check_a2dp_restore(a2dp.adev, uc_info->stream.out, true);
pthread_mutex_lock(&a2dp.adev->lock);