From 831ad5246fcfcd3c91e02c079a0aee997c895ddf Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Wed, 1 Dec 2010 14:15:21 -0800 Subject: [PATCH] Fix issue 2641884: Bluetooth volume is dependent on in call volume. The problem is that the code in AudioPolicyManagerBase::checkAndSetVolume() that forces voice volume to max when setting bluetooth SCO volume is not called if the bluetooth stream volume did not actually change. So even if we re apply volumes when switching to bluetooth device, the voice volume is not changed in audio HAL and remains what it was when routed to earpiece. What makes things worse on Passion is that stream volumes are limited when connected to bluetooth and their actual value does not change as soon as they exceed the limit threshold. Change-Id: Ieb72a71e06e9b3079cc8bc76c78ce83e060a2ea2 --- include/hardware_legacy/AudioPolicyManagerBase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h index 51dc684..8ffaad9 100644 --- a/include/hardware_legacy/AudioPolicyManagerBase.h +++ b/include/hardware_legacy/AudioPolicyManagerBase.h @@ -302,6 +302,7 @@ protected: nsecs_t mMusicStopTime; // time when last music stream was stopped bool mLimitRingtoneVolume; // limit ringtone volume to music volume if headset connected uint32_t mDeviceForStrategy[NUM_STRATEGIES]; + float mLastVoiceVolume; // last voice volume value sent to audio HAL // Maximum CPU load allocated to audio effects in 0.1 MIPS (ARMv5TE, 0 WS memory) units static const uint32_t MAX_EFFECTS_CPU_LOAD = 1000;