From fe43d163d6646a175934f0752fa05e3e53e89da4 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 30 Oct 2012 16:14:04 -0700 Subject: audio policy: fix volume problem - DO NOT MERGE merge from master: "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 --- audio/AudioPolicyManagerBase.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index a082239..19fff57 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); } -- cgit v1.1