hal: check for sco device to ensure a2dp can be disabled
During a2dp and sco concurrency usecaes, some outputs
may have audio device changed to a2dp while others are
leaving as sco, due to they share same backend, outputs
with sco audio device can still be switched to a2dp snd
device, in order not to assign sco device to the one which
needs to switch to speaker, need to check sco as well.
Change-Id: I74f1c10ba42c2007f89164b7edbcb353a2ae80c9
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 32f9ce1..7fcd229 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -10506,14 +10506,15 @@
usecase = node_to_item(node, struct audio_usecase, list);
if ((usecase->type != PCM_CAPTURE) && (usecase != uc_info) &&
!is_a2dp_out_device_type(&usecase->stream.out->device_list) &&
+ !is_sco_out_device_type(&usecase->stream.out->device_list) &&
platform_check_backends_match(SND_DEVICE_OUT_SPEAKER,
usecase->out_snd_device)) {
assign_devices(&out->device_list, &usecase->stream.out->device_list);
break;
}
}
- if (is_a2dp_out_device_type(&devices) &&
- list_length(&devices) == 1) {
+ if ((is_a2dp_out_device_type(&devices) && list_length(&devices) == 1) ||
+ (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)) {
out->a2dp_muted = true;
if (is_offload_usecase(out->usecase)) {
if (out->offload_state == OFFLOAD_STATE_PLAYING)