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

Commit bbfb7090 authored by Aravind Angadi's avatar Aravind Angadi Committed by Yan Han
Browse files

CEC: Implement handleReportArcTermination method

Bug: 159901363
Test: None

Change-Id: I0d22678f09219e47aa93af13992c3050b32334a8
parent 527d7f06
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -49,10 +49,7 @@ public class ArcTerminationActionFromAvr extends HdmiCecFeatureAction {
        switch (cmd.getOpcode()) {
            case Constants.MESSAGE_REPORT_ARC_TERMINATED:
                mState = STATE_ARC_TERMINATED;
                audioSystem().setArcStatus(false);
                if (audioSystem().getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
                    audioSystem().routeToInputFromPortId(audioSystem().getRoutingPort());
                }
                audioSystem().processArcTermination();
                finish();
                return true;
        }
+9 −2
Original line number Diff line number Diff line
@@ -372,8 +372,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
    @Constants.HandleMessageResult
    protected int handleReportArcTermination(HdmiCecMessage message) {
        assertRunOnServiceThread();
        // TODO(amyjojo): implement report arc terminate handler
        HdmiLogger.debug(TAG + "Stub handleReportArcTermination");
        processArcTermination();
        return Constants.HANDLED;
    }

@@ -716,6 +715,14 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
        mArcEstablished = enabled;
    }

    void processArcTermination() {
        setArcStatus(false);
        // Switch away from ARC input when ARC is terminated.
        if (getLocalActivePort() == Constants.CEC_SWITCH_ARC) {
            routeToInputFromPortId(getRoutingPort());
        }
    }

    /** Switch hardware ARC circuit in the system. */
    @ServiceThreadOnly
    private void enableAudioReturnChannel(boolean enabled) {