audio: Fix to avoid co-existance of usb and voice-usb
Avoid co-existance of different modes of the same
device. This can potentially cause conflicts as the
a base device can be operated under different modes
concurrently but yet share the same controls.
Avoid state mismatches buy avoiding such co-existance
scenanios
Bug: 63258828
Test: Duo and Hangouts valls with and without USB headset
Change-Id: I8cfa9ef700cbde3abc5696c464712608bc2b14c7
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index ee25242..677d883 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -866,7 +866,8 @@
if (force_routing ||
(usecase->out_snd_device != snd_device &&
- usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND &&
+ (usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND ||
+ usecase->devices & (AUDIO_DEVICE_OUT_USB_DEVICE|AUDIO_DEVICE_OUT_USB_HEADSET)) &&
platform_check_backends_match(snd_device, usecase->out_snd_device))) {
ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
__func__, use_case_table[usecase->id],