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

Commit 212c3d53 authored by Donghyun Cho's avatar Donghyun Cho Committed by android-build-merger
Browse files

Merge "docs: Updated Billing API documentation (for Project Nickel)." into...

Merge "docs: Updated Billing API documentation (for Project Nickel)." into mnc-io-docs am: 5ea88aad am: 1ee79303 am: 29bcedc4 am: 9ac566bb
am: 257c7c74

* commit '257c7c74':
  CEC: Update system audio mode based on the current status of AVR

Change-Id: Ie38de3a4eea26522333c0300159f6399b730b7ba
parents 54c30714 257c7c74
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -826,9 +826,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
    @ServiceThreadOnly
    void onNewAvrAdded(HdmiDeviceInfo avr) {
        assertRunOnServiceThread();
        if (getSystemAudioModeSetting() && !isSystemAudioActivated()) {
        addAndStartAction(new SystemAudioAutoInitiationAction(this, avr.getLogicalAddress()));
        }
        if (isArcFeatureEnabled(avr.getPortId())
                && !hasAction(SetArcTransmissionStateAction.class)) {
            startArcAction(true);
@@ -1172,12 +1170,13 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
            if (getAvrDeviceInfo() == null) {
                // AVR may not have been discovered yet. Delay the message processing.
                mDelayedMessageBuffer.add(message);
                return true;
            }
            } else {
                HdmiLogger.warning("Invalid <Set System Audio Mode> message:" + message);
                mService.maySendFeatureAbortCommand(message, Constants.ABORT_REFUSED);
            }
            return true;
        }
        removeAction(SystemAudioAutoInitiationAction.class);
        SystemAudioActionFromAvr action = new SystemAudioActionFromAvr(this,
                message.getSource(), HdmiUtils.parseCommandParamSystemAudioStatus(message), null);
        addAndStartAction(action);
+7 −5
Original line number Diff line number Diff line
@@ -64,13 +64,13 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
        }

        if (cmd.getOpcode() == Constants.MESSAGE_SYSTEM_AUDIO_MODE_STATUS) {
            handleSystemAudioModeStatusMessage();
            handleSystemAudioModeStatusMessage(HdmiUtils.parseCommandParamSystemAudioStatus(cmd));
            return true;
        }
        return false;
    }

    private void handleSystemAudioModeStatusMessage() {
    private void handleSystemAudioModeStatusMessage(boolean isSystemAudioModeOn) {
        if (!canChangeSystemAudio()) {
            HdmiLogger.debug("Cannot change system audio mode in auto initiation action.");
            finish();
@@ -78,9 +78,11 @@ final class SystemAudioAutoInitiationAction extends HdmiCecFeatureAction {
        }

        boolean systemAudioModeSetting = tv().getSystemAudioModeSetting();
        // Update AVR's system audio mode regardless of AVR's status.
        addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting,
                null));
        if (systemAudioModeSetting && !isSystemAudioModeOn) {
            addAndStartAction(new SystemAudioActionFromTv(tv(), mAvrAddress, systemAudioModeSetting, null));
        } else {
            tv().setSystemAudioMode(isSystemAudioModeOn, true);
        }
        finish();
    }