audio policy: fix notification + voicemail routing
Consider an active VOICE_CALL stream as an indication
that notification routing and volume should match voice call routing.
Also limit notification volume to match current VOICE_CALL volume index,
not just VOICE_CALL volume curve with notification volume index.
Bug: 74019016
Test: manual: receive notification while listening to voicemail and
check volume and routing.
Change-Id: Ia9309bdb10b42f6a4fa8745daf3129c90d44f0b8
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index be7f7ec..08bcf4d 100644
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -266,7 +266,7 @@
break;
case STRATEGY_SONIFICATION_RESPECTFUL:
- if (isInCall()) {
+ if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
device = getDeviceForStrategyInt(
STRATEGY_SONIFICATION, availableOutputDevices, availableInputDevices, outputs,
outputDeviceTypesToIgnore);
@@ -409,7 +409,7 @@
// If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
// handleIncallSonification().
- if (isInCall()) {
+ if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
device = getDeviceForStrategyInt(
STRATEGY_PHONE, availableOutputDevices, availableInputDevices, outputs,
outputDeviceTypesToIgnore);