From 2cbe89a82d4167c5d5bcf3024edc22ab6874143a Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 19 Dec 2014 11:49:08 -0800 Subject: audio policy: improve accessibility routing Force re-evaluating accessibility use case routing when a condition affecting it (ringtone, alarm, call state) is changing. Bug: 18761698. Change-Id: I42ac3a9fdc80bce11cf0a7fc76f680af4271abc9 --- services/audiopolicy/AudioPolicyManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index a3389e0..be7158f 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -596,6 +596,9 @@ void AudioPolicyManager::setPhoneState(audio_mode_t state) } handleIncallSonification((audio_stream_type_t)stream, false, true); } + + // force reevaluating accessibility routing when call starts + mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); } // store previous phone state for management of sonification strategy below @@ -1290,6 +1293,11 @@ status_t AudioPolicyManager::startOutput(audio_io_handle_t output, outputDesc->mPolicyMix->mRegistrationId); } + // force reevaluating accessibility routing when ringtone or alarm starts + if (strategy == STRATEGY_SONIFICATION) { + mpClientInterface->invalidateStream(AUDIO_STREAM_ACCESSIBILITY); + } + if (waitMs > muteWaitMs) { usleep((waitMs - muteWaitMs) * 2 * 1000); } -- cgit v1.1