hal: check usecase type before checking out_snd_device backend match
input_snd_device for voip_call may be wrongly switched when selecting
device for other usecase like audio-record with voip active because of
regression of previous change, thus when VoIP use out_snd_device of
other usecase for cal block register, it may fail because other usecase
has no out_snd_device and finally Rx gets mute.
Only check out_snd_device backend match for usecase type PCM_PLAYBACK.
Change-Id: Id063b47e5c154249e502b7abfb9a639d3229dbba
CRs-Fixed: 2046903
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 7b69ca2..5b320d7 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1528,7 +1528,9 @@
} else if (voice_extn_compress_voip_is_active(adev)) {
bool out_snd_device_backend_match = true;
voip_usecase = get_usecase_from_list(adev, USECASE_COMPRESS_VOIP_CALL);
- if (usecase->stream.out != NULL) {
+ if ((voip_usecase != NULL) &&
+ (usecase->type == PCM_PLAYBACK) &&
+ (usecase->stream.out != NULL)) {
out_snd_device_backend_match = platform_check_backends_match(
voip_usecase->out_snd_device,
platform_get_output_snd_device(