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

Commit 743bc3d4 authored by Vlad Popa's avatar Vlad Popa Committed by Android (Google) Code Review
Browse files

Merge "audio: Fix mute state handling issue for HDMI-CEC" into main

parents 92688249 978de75e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4675,6 +4675,11 @@ public class AudioService extends IAudioService.Stub
                    TAG + ".onSetStreamVolume", false /*external*/);
        }
        setStreamVolumeInt(stream, index, device, false, caller, hasModifyAudioSettings);
        // setting volume from Hdmi-CEC system audio, skip unmuting the stream being modified and
        // the aliased streams.
        if ((flags & AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME) != 0) {
            return;
        }
        // setting non-zero volume for a muted stream unmutes the stream and vice versa
        // except for BT SCO stream where only explicit mute is allowed to comply to BT requirements
        if (!isStreamBluetoothSco(streamType) && canChangeMute) {
+4 −2
Original line number Diff line number Diff line
@@ -4991,7 +4991,8 @@ public class HdmiControlService extends SystemService {
                getAudioManager().getDevicesForAttributes(STREAM_MUSIC_ATTRIBUTES);
        for (AudioDeviceAttributes streamMusicDevice : streamMusicDevices) {
            if (getAvbCapableAudioOutputDevices().contains(streamMusicDevice)) {
                int flags = AudioManager.FLAG_ABSOLUTE_VOLUME;
                int flags = AudioManager.FLAG_ABSOLUTE_VOLUME
                        | AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME;
                if (isTvDevice()) {
                    flags |= AudioManager.FLAG_SHOW_UI;
                }
@@ -5012,7 +5013,8 @@ public class HdmiControlService extends SystemService {
        for (AudioDeviceAttributes streamMusicDevice : streamMusicDevices) {
            if (getAvbCapableAudioOutputDevices().contains(streamMusicDevice)) {
                int direction = mute ? AudioManager.ADJUST_MUTE : AudioManager.ADJUST_UNMUTE;
                int flags = AudioManager.FLAG_ABSOLUTE_VOLUME;
                int flags = AudioManager.FLAG_ABSOLUTE_VOLUME
                        | AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME;
                if (isTvDevice()) {
                    flags |= AudioManager.FLAG_SHOW_UI;
                }