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

Commit a981a715 authored by Jungshik Jang's avatar Jungshik Jang Committed by Android Git Automerger
Browse files

am 7403d656: am 324b1f8a: Merge "CEC: Send <Give System Audio Mode> regardless...

am 7403d656: am 324b1f8a: Merge "CEC: Send <Give System Audio Mode> regardless of TV\'s setting." into lmp-mr1-dev

* commit '7403d656':
  CEC: Send <Give System Audio Mode> regardless of TV's setting.
parents 3e03e8b2 7403d656
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -706,9 +706,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    @ServiceThreadOnly
    void onNewAvrAdded(HdmiDeviceInfo avr) {
    void onNewAvrAdded(HdmiDeviceInfo avr) {
        assertRunOnServiceThread();
        assertRunOnServiceThread();
        if (getSystemAudioModeSetting()) {
        addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
        addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
        }
        if (isArcFeatureEnabled()) {
        if (isArcFeatureEnabled()) {
            startArcAction(true);
            startArcAction(true);
        }
        }
+9 −12
Original line number Original line Diff line number Diff line
@@ -71,19 +71,16 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
    }
    }


    private void handleSystemAudioModeStatusMessage() {
    private void handleSystemAudioModeStatusMessage() {
        // If the last setting is system audio, turn on system audio whatever AVR status is.
        if (!canChangeSystemAudio()) {
        if (tv().getSystemAudioModeSetting()) {
            HdmiLogger.debug("Cannot change system audio mode in auto initiation action.");
            if (canChangeSystemAudio()) {
            finish();
                addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, true, null));
            return;
            }
        } else {
            // If the last setting is non-system audio, turn off system audio mode
            // and update system audio status (volume or mute).
            tv().setSystemAudioMode(false, true);
            if (canChangeSystemAudio()) {
                addAndStartAction(new SystemAudioStatusAction(tv(), mAvrAddress, null));
            }
        }
        }

        boolean systemAudioModeSetting = tv().getSystemAudioModeSetting();
        // Update AVR's system audio mode regardless of AVR's status.
        addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting,
                null));
        finish();
        finish();
    }
    }