summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-06-06 17:39:16 -0700
committerEric Laurent <elaurent@google.com>2012-06-06 17:39:16 -0700
commitac3cf10ef6de12e69540a1244ac7255f93fa7502 (patch)
tree69758b1fdda1850eb44f9981f5d348ed0b6ebebb
parent3cdfddf1b27bcb5408ca3a04fcdf206447ba07ba (diff)
downloadhardware_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.cpp3
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,