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

Commit 978de75e authored by Tomoki Yonezawa's avatar Tomoki Yonezawa Committed by Vlad Popa
Browse files

audio: Fix mute state handling issue for HDMI-CEC



Issue:
Some Audio Systems (HDMI-CEC devices) in the market are designed to
"maintain mute status while decreasing volume."
When volume of an Audio System is decreased during mute,
the volume UI incorrectly shows unmute state,
even though the Audio System remains muted.

Root Cause:
The AudioFramework automatically unmutes when it receives any
volume setting command, even when HDMI-CEC Report Audio Status
from the Audio System indicates the device is still muted.

Solution:
Modify the AudioFramework to not update the mute state
when processing volume settings for HDMI-CEC Report Audio Status.

Bug: 410740830
Test: manual - press the volume key on the HDMI-CEC device remote
control while audio is muted
Flag: EXEMPT bugfix

Change-Id: Idcc740600e993cf99908ff92a135191fc23147ac
Signed-off-by: default avatarTomoki Yonezawa <Tomoki.Yonezawa@sony.com>
parent 613d31be
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4598,6 +4598,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;
                }