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>
(cherry picked from commit 0a1160cff83a82c95b3d7835a76af83569020d17)
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 9f90d93..d8e318a 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1666,6 +1666,10 @@
                 ((uc_info->devices & backend_check_cond) &&
                  (((usecase->devices & ~AUDIO_DEVICE_BIT_IN) & AUDIO_DEVICE_IN_ALL_CODEC_BACKEND) ||
                   (usecase->type == VOIP_CALL))) &&
+                ((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],