HAL: Handle case 7 in derive_playback_snd_device
after SSR is triggered during playback on headset and
ringtone concurrency use-case, ringtone plays only on headset.
this use-case falls under case 7 which is not handled
by derive_playback_snd_device.
fix the issue by adding a condition to handle this use-case.
Change-Id: Ia8387de0591adb5ec864b1fce5af07620a9e2e3f
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index b759f4d..7645c3c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1532,14 +1532,11 @@
goto end;
}
- // NB: case 7 is hypothetical and isn't a practical usecase yet.
- // But if it does happen, we need to give priority to d2 if
- // the combo devices active on the existing usecase share a backend.
- // This is because we cannot have a usecase active on a combo device
- // and a new usecase requests one device in this combo pair.
if (platform_check_backends_match(d3[0], d3[1])) {
return d2; // case 5
} else {
+ if (popcount(a1) > 1)
+ return d1; //case 7
// check if d1 is related to any of d3's
if (d1 == d3[0] || d1 == d3[1])
return d1; // case 1