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

Commit 1a6be6ed authored by Jungshik Jang's avatar Jungshik Jang
Browse files

Adjust volume bar visibility in HDMI-CEC system audio mode

When HDMI-CEC system audio mode is activated.
1. Hide volume bar when volume button is pressed in TV
2. Show volume bar when TV receives volume notification from
   Audio Receiver.

Otherwise, (system audio mode off) follows normal TV's behavior.

Bug: 17347499

Change-Id: I1f5bc14285d60d8626a8fbbef9e1959cae7d193b
parent 1a526f58
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1351,6 +1351,16 @@ public class AudioService extends IAudioService.Stub {
            streamType = AudioSystem.STREAM_NOTIFICATION;
        }

        // If Hdmi-CEC system audio mode is on, show volume bar
        // only when TV receives volume notification from Audio Receiver.
        if (mHdmiTvClient != null && streamType == AudioSystem.STREAM_MUSIC) {
            synchronized (mHdmiTvClient) {
                if (mHdmiSystemAudioSupported &&
                        ((flags & AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME) == 0)) {
                    flags &= ~AudioManager.FLAG_SHOW_UI;
                }
            }
        }
        mVolumeController.postVolumeChanged(streamType, flags);

        if ((flags & AudioManager.FLAG_FIXED_VOLUME) == 0) {
+1 −1
Original line number Diff line number Diff line
@@ -798,7 +798,7 @@ public final class HdmiControlService extends SystemService {
            // FLAG_HDMI_SYSTEM_AUDIO_VOLUME prevents audio manager from announcing
            // volume change notification back to hdmi control service.
            audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, volume,
                    AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
                    AudioManager.FLAG_SHOW_UI | AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME);
        }
    }