Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ebad4da authored by Eric Laurent's avatar Eric Laurent Committed by Automerger Merge Worker
Browse files

Merge "AudioService: fix volume group mute" into rvc-dev am: ff373b46

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11844163

Change-Id: I0db266f5333f7f9889291e5ee3d6d8105e92b9b6
parents c7f4433c ff373b46
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5322,6 +5322,15 @@ public class AudioService extends IAudioService.Stub
        }

        private void setVolumeIndexInt(int index, int device, int flags) {
            // Reflect mute state of corresponding stream by forcing index to 0 if muted
            // Only set audio policy BT SCO stream volume to 0 when the stream is actually muted.
            // This allows RX path muting by the audio HAL only when explicitly muted but not when
            // index is just set to 0 to repect BT requirements
            if (mStreamStates[mPublicStreamType].isFullyMuted()) {
                index = 0;
            } else if (mPublicStreamType == AudioSystem.STREAM_BLUETOOTH_SCO && index == 0) {
                index = 1;
            }
            // Set the volume index
            AudioSystem.setVolumeIndexForAttributes(mAudioAttributes, index, device);
        }