diff options
author | Eric Laurent <elaurent@google.com> | 2012-10-30 16:14:04 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-10-30 16:14:04 -0700 |
commit | 2c72e9faa5ad5e324b85b78e383dd85c8bdc04a9 (patch) | |
tree | abb3a4bf9214fc94115d65f4f7777f88b51fc843 /audio | |
parent | 5b40644acbfabfb45b1fd4dcb56570c4964317f6 (diff) | |
download | hardware_libhardware_legacy-2c72e9faa5ad5e324b85b78e383dd85c8bdc04a9.zip hardware_libhardware_legacy-2c72e9faa5ad5e324b85b78e383dd85c8bdc04a9.tar.gz hardware_libhardware_legacy-2c72e9faa5ad5e324b85b78e383dd85c8bdc04a9.tar.bz2 |
audio policy: fix volume change when disabling SCO
commit 76e97d39 introduced a regression by having setDeviceConnectionState()
force a device change on duplicated outputs even if the selected device is 0.
This also forces a device 0 for the two outputs it is duplicated to,
which may override a valid device selection on those outputs and apply
default volumes.
Bug 7429869.
Change-Id: I37dd66343c54eb27e420089edbda04444fa1e2c6
Diffstat (limited to 'audio')
-rw-r--r-- | audio/AudioPolicyManagerBase.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index 906c3fc..4849041 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -169,9 +169,12 @@ status_t AudioPolicyManagerBase::setDeviceConnectionState(audio_devices_t device updateDevicesAndOutputs(); for (size_t i = 0; i < mOutputs.size(); i++) { + // do not force device change on duplicated output because if device is 0, it will + // also force a device 0 for the two outputs it is duplicated to which may override + // a valid device selection on those outputs. setOutputDevice(mOutputs.keyAt(i), getNewDevice(mOutputs.keyAt(i), true /*fromCache*/), - true, + !mOutputs.valueAt(i)->isDuplicated(), 0); } |