audiopolicy: fix for ringtone and offload music playback concurrency
Root cause: music output is still active when setphonestate and will be
reevaluate routing and change back to normal speaker.
follow the change of https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/av/+/4292147
Bug: 110072502
Test: self-tested over 30 times.
Change-Id: Iec1c85f9cd24e3eae149fa27ad8d1ec2b23019e0
Signed-off-by: Yung Ti Su <andysu@google.com>
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 7154cb2..958ac30 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -4842,7 +4842,7 @@
} else if (isInCall() ||
isStrategyActiveOnSameModule(outputDesc, STRATEGY_PHONE)) {
device = getDeviceForStrategy(STRATEGY_PHONE, fromCache);
- } else if (isStrategyActive(outputDesc, STRATEGY_SONIFICATION)) {
+ } else if (isStrategyActiveOnSameModule(outputDesc, STRATEGY_SONIFICATION)) {
device = getDeviceForStrategy(STRATEGY_SONIFICATION, fromCache);
} else if (isStrategyActive(outputDesc, STRATEGY_ENFORCED_AUDIBLE)) {
device = getDeviceForStrategy(STRATEGY_ENFORCED_AUDIBLE, fromCache);