audio: restrict the force route condition
select_devices should only force route the
capture usecase(s) with snd_device that
shares the same backend with current
usecase.
For example, the "voice-call afe-proxy" doesn't
need to force route the device of audio-record
to be "voice-rx".
Bug: 113700667
Test: manual
Change-Id: I144c9b8e201b2331064cac62367b2839ceec9c9a
Signed-off-by: Carter Hsu <carterhsu@google.com>
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index e1d5309..5d1b0af 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1173,6 +1173,10 @@
if (usecase->type != PCM_PLAYBACK &&
usecase != uc_info &&
usecase->in_snd_device != snd_device &&
+ ((uc_info->type == VOICE_CALL &&
+ usecase->devices == AUDIO_DEVICE_IN_VOICE_CALL) ||
+ platform_check_backends_match(snd_device,\
+ usecase->in_snd_device)) &&
(usecase->id != USECASE_AUDIO_SPKR_CALIB_TX)) {
ALOGV("%s: Usecase (%s) is active on (%s) - disabling ..",
__func__, use_case_table[usecase->id],