OSDN Git Service

audio policy: apply default device volume
authorEric Laurent <elaurent@google.com>
Mon, 15 Jul 2013 22:35:58 +0000 (15:35 -0700)
committerEric Laurent <elaurent@google.com>
Mon, 15 Jul 2013 22:41:08 +0000 (15:41 -0700)
Make sure that we apply default device volume to
active outputs in case no specific volume for selected
device is received afterward.

Bug: 9760269.
Change-Id: I216de40396e1075e77493c97e8b192cd3a31d546

audio/AudioPolicyManagerBase.cpp

index 236bf69..bf3f36a 100644 (file)
@@ -1036,7 +1036,7 @@ status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type s
     for (size_t i = 0; i < mOutputs.size(); i++) {
         audio_devices_t curDevice =
                 getDeviceForVolume(mOutputs.valueAt(i)->device());
-        if (device == curDevice) {
+        if ((device == AUDIO_DEVICE_OUT_DEFAULT) || (device == curDevice)) {
             status_t volStatus = checkAndSetVolume(stream, index, mOutputs.keyAt(i), curDevice);
             if (volStatus != NO_ERROR) {
                 status = volStatus;