diff options
author | 2010-03-09 09:26:08 -0800 | |
---|---|---|
committer | 2010-03-09 12:45:55 -0800 | |
commit | 758559e6b7e310cf46cc269437f44decd58d68d6 (patch) | |
tree | 33b262fca683199cfcf6da3ab44c5d738731dced /libs/audioflinger/AudioPolicyManagerBase.cpp | |
parent | a9fb0a2497e563c2066e10a816ff1f7baaf8aa9b (diff) |
Fix bug 2329540
Part 1 of the fix: when the user doesn't elect to use the car dock
for music and media, the APM was not aware of the device being
docked.
This is fixed by dissociating the notification for the APM of
the docking to the dock from the sink state change of the A2DP
device.
Also missing was forcing the volumes to be reevaluated whenever
the device is docked or undocked, as volumes for docks may
differ, even when the same output device is being used.
Change-Id: If5314e27821a71adbd6df6fdf887c45208241d96
Diffstat (limited to 'libs/audioflinger/AudioPolicyManagerBase.cpp')
-rw-r--r-- | libs/audioflinger/AudioPolicyManagerBase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/audioflinger/AudioPolicyManagerBase.cpp b/libs/audioflinger/AudioPolicyManagerBase.cpp index cfcc3ea9e2ee..2b0a6c8c55f1 100644 --- a/libs/audioflinger/AudioPolicyManagerBase.cpp +++ b/libs/audioflinger/AudioPolicyManagerBase.cpp @@ -344,6 +344,7 @@ void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSyst { LOGV("setForceUse() usage %d, config %d, mPhoneState %d", usage, config, mPhoneState); + bool forceVolumeReeval = false; switch(usage) { case AudioSystem::FOR_COMMUNICATION: if (config != AudioSystem::FORCE_SPEAKER && config != AudioSystem::FORCE_BT_SCO && @@ -374,6 +375,7 @@ void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSyst config != AudioSystem::FORCE_BT_DESK_DOCK && config != AudioSystem::FORCE_WIRED_ACCESSORY) { LOGW("setForceUse() invalid config %d for FOR_DOCK", config); } + forceVolumeReeval = true; mForceUse[usage] = config; break; default: @@ -388,6 +390,9 @@ void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSyst #endif updateDeviceForStrategy(); setOutputDevice(mHardwareOutput, newDevice); + if (forceVolumeReeval) { + applyStreamVolumes(mHardwareOutput, newDevice); + } } AudioSystem::forced_config AudioPolicyManagerBase::getForceUse(AudioSystem::force_use usage) |