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

Commit 61fc25f7 authored by Amy's avatar Amy Committed by shubang
Browse files

Unmute when turning system audio mode on.

ag/5428480

This is useful for devices that disables muting.
When TV sends out muting to the device but the device later turns system
audio mode back on, it should still unmute itself.

Disabling muting should only disable self mute. But still support
unmute.

Test: manual
Bug: 118890232
Change-Id: Ief4435c786262a1981a29627b837ef0a4831157a
parent 51c6a63e
Loading
Loading
Loading
Loading
+12 −10
Original line number Original line Diff line number Diff line
@@ -753,9 +753,10 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
        // PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE is false when device never needs to be muted.
        // PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE is false when device never needs to be muted.
        boolean currentMuteStatus =
        boolean currentMuteStatus =
                mService.getAudioManager().isStreamMute(AudioManager.STREAM_MUSIC);
                mService.getAudioManager().isStreamMute(AudioManager.STREAM_MUSIC);
        if (currentMuteStatus == newSystemAudioMode) {
            if (SystemProperties.getBoolean(
            if (SystemProperties.getBoolean(
                    Constants.PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE, true)
                    Constants.PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE, true)
                && currentMuteStatus == newSystemAudioMode) {
                            || newSystemAudioMode) {
                mService.getAudioManager()
                mService.getAudioManager()
                        .adjustStreamVolume(
                        .adjustStreamVolume(
                                AudioManager.STREAM_MUSIC,
                                AudioManager.STREAM_MUSIC,
@@ -764,6 +765,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
                                        : AudioManager.ADJUST_MUTE,
                                        : AudioManager.ADJUST_MUTE,
                                0);
                                0);
            }
            }
        }
        updateAudioManagerForSystemAudio(newSystemAudioMode);
        updateAudioManagerForSystemAudio(newSystemAudioMode);
        synchronized (mLock) {
        synchronized (mLock) {
            if (mSystemAudioActivated != newSystemAudioMode) {
            if (mSystemAudioActivated != newSystemAudioMode) {