From 63dea1d5334acf3baa9448086dd504ead57d814b Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 2 Jul 2015 17:10:28 -0700 Subject: audio policy: fix regression in incall notification management Commit 2110e04c introduced a regression preventing ongoing alarms to be restored when exiting a call and leaving the replacement tone playing for ever. Also add missing management of accessibility prompts when entering a call. Bug: 21857005. Change-Id: I4295c791c003db42c0fba9f618e51f60438158d1 --- services/audiopolicy/managerdefault/AudioPolicyManager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'services/audiopolicy/managerdefault') diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp index ee25b71..6983b5c 100644 --- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp +++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp @@ -427,7 +427,7 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state) /// Opens: can these line be executed after the switch of volume curves??? // if leaving call state, handle special case of active streams // pertaining to sonification strategy see handleIncallSonification() - if (isInCall()) { + if (isStateInCall(oldState)) { ALOGV("setPhoneState() in call state management: new state is %d", state); for (int stream = 0; stream < AUDIO_STREAM_CNT; stream++) { if (stream == AUDIO_STREAM_PATCH) { @@ -436,7 +436,7 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state) handleIncallSonification((audio_stream_type_t)stream, false, true); } - // force reevaluating accessibility routing when call starts + // force reevaluating accessibility routing when call stops mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); } @@ -514,6 +514,9 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state) } handleIncallSonification((audio_stream_type_t)stream, true, true); } + + // force reevaluating accessibility routing when call starts + mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); } // Flag that ringtone volume must be limited to music volume until we exit MODE_RINGTONE -- cgit v1.1