From ac3cf10ef6de12e69540a1244ac7255f93fa7502 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 6 Jun 2012 17:39:16 -0700 Subject: audio policy: fix notification volume limitation The limitation of notification volume when playing music over headphones has been broken for devices where notifications and music are played over separate output streams. Fix computeVolume() to check music stream activity on all outputs. Bug 6623707. Change-Id: Ie25f9b428ea086efe0be5fea2d31551d2528b655 --- audio/AudioPolicyManagerBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index 9522000..77709ba 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -2639,7 +2639,8 @@ float AudioPolicyManagerBase::computeVolume(int stream, // when the phone is ringing we must consider that music could have been paused just before // by the music application and behave as if music was active if the last music track was // just stopped - if (outputDesc->mRefCount[AudioSystem::MUSIC] || mLimitRingtoneVolume) { + if (isStreamActive(AudioSystem::MUSIC, SONIFICATION_HEADSET_MUSIC_DELAY) || + mLimitRingtoneVolume) { float musicVol = computeVolume(AudioSystem::MUSIC, mStreams[AudioSystem::MUSIC].getVolumeIndex(device), output, -- cgit v1.1