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

Commit 8d3d4689 authored by daren.liao's avatar daren.liao Committed by Austin Shin
Browse files

Set SAM according to TV's settings

[Description]
Issue occur when
1) SystemAudioAutoInitiationAction timeout
2) receive <System Audio Mode Status>[OFF]
3) TV handles <System Audio Mode Status>[OFF]

In this case, TV will turn off SAM and ARC, which is unexpected

Bug: 156579158
Test: by OEM, AVR attached TV power off and on.

Change-Id: I2c68fe48210f132283f63d51646455039ff8b53a
parent 81796976
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1165,7 +1165,21 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
            // Ignore this message.
            return true;
        }
        setSystemAudioMode(HdmiUtils.parseCommandParamSystemAudioStatus(message));
        boolean tvSystemAudioMode = isSystemAudioControlFeatureEnabled();
        boolean avrSystemAudioMode = HdmiUtils.parseCommandParamSystemAudioStatus(message);
        // Set System Audio Mode according to TV's settings.
        // Handle <System Audio Mode Status> here only when
        // SystemAudioAutoInitiationAction timeout
        HdmiDeviceInfo avr = getAvrDeviceInfo();
        if (avr == null) {
            setSystemAudioMode(false);
        } else if (avrSystemAudioMode != tvSystemAudioMode) {
            addAndStartAction(new SystemAudioActionFromTv(this, avr.getLogicalAddress(),
                    tvSystemAudioMode, null));
        } else {
            setSystemAudioMode(tvSystemAudioMode);
        }

        return true;
    }