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

Commit c1a1bd06 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I0d22678f,Ibdff6d2c into sc-dev

* changes:
  CEC: Implement handleReportArcTermination method
  CEC: Implement handleReportArcInitiate method
parents ae4d48eb bbfb7090
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;
        }
+15 −4
Original line number Diff line number Diff line
@@ -358,8 +358,12 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource {
    @Constants.HandleMessageResult
    protected int handleReportArcInitiate(HdmiCecMessage message) {
        assertRunOnServiceThread();
        // TODO(amyjojo): implement report arc initiate handler
        HdmiLogger.debug(TAG + "Stub handleReportArcInitiate");
        /*
         * Ideally, we should have got this response before the {@link ArcInitiationActionFromAvr}
         * has timed out. Even if the response is late, {@link ArcInitiationActionFromAvr
         * #handleInitiateArcTimeout()} would not have disabled ARC. So nothing needs to be done
         * here.
         */
        return Constants.HANDLED;
    }

@@ -368,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;
    }

@@ -712,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) {