diff options
author | Eric Laurent <elaurent@google.com> | 2012-06-06 17:39:16 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-06-06 17:39:16 -0700 |
commit | ac3cf10ef6de12e69540a1244ac7255f93fa7502 (patch) | |
tree | 69758b1fdda1850eb44f9981f5d348ed0b6ebebb | |
parent | 3cdfddf1b27bcb5408ca3a04fcdf206447ba07ba (diff) | |
download | hardware_libhardware_legacy-ac3cf10ef6de12e69540a1244ac7255f93fa7502.zip hardware_libhardware_legacy-ac3cf10ef6de12e69540a1244ac7255f93fa7502.tar.gz hardware_libhardware_legacy-ac3cf10ef6de12e69540a1244ac7255f93fa7502.tar.bz2 |
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
-rw-r--r-- | audio/AudioPolicyManagerBase.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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, |