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

Commit 5bb8ae06 authored by Amy Zhang's avatar Amy Zhang Committed by Android (Google) Code Review
Browse files

Merge "Correct Audio System device unplug behavior on SAM and ARC"

parents 6ee94f24 1aca8a71
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,11 @@ public class ArcTerminationActionFromAvr extends HdmiCecFeatureAction {
        sendCommand(HdmiCecMessageBuilder.buildTerminateArc(getSourceAddress(), Constants.ADDR_TV),
            result -> {
                if (result != SendMessageResult.SUCCESS) {
                    // If the physical connection is already off or TV does not handle
                    // Terminate ARC, turn off ARC internally.
                    if (result == SendMessageResult.NACK) {
                        audioSystem().setArcStatus(false);
                    }
                    HdmiLogger.debug("Terminate ARC was not successfully sent.");
                    finish();
                }
+9 −0
Original line number Diff line number Diff line
@@ -304,6 +304,15 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
        }
        if (mService.getPortInfo(portId).getType() == HdmiPortInfo.PORT_OUTPUT) {
            mCecMessageCache.flushAll();
            if (!connected) {
                if (isSystemAudioActivated()) {
                    mTvSystemAudioModeSupport = null;
                    checkSupportAndSetSystemAudioMode(false);
                }
                if (isArcEnabled()) {
                    setArcStatus(false);
                }
            }
        } else if (!connected && mPortIdToTvInputs.get(portId) != null) {
            String tvInputId = mPortIdToTvInputs.get(portId);
            HdmiDeviceInfo info = mTvInputsToDeviceInfo.get(tvInputId);