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

Commit 71651d37 authored by Jinsuk Kim's avatar Jinsuk Kim
Browse files

CEC: Do not send <ARC Terminated> when init request gets rejected

System audio may reject <Request ARC Initiation> with a response
<Feature Abort> or just time out. Do not send <Request ARC Terminated>
in response so as not to turn off the ARC mode, as it may not be
the intended behavior.

Bug: 19928094

Change-Id: I469dfa53bf35dfbca7daa86a69763b10551663ec
parent bf267338
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -58,14 +58,16 @@ abstract class RequestArcAction extends HdmiCecFeatureAction {
            // received without <Request ARC Initiation> or <Request ARC Termination>.
            case Constants.MESSAGE_FEATURE_ABORT:
                int originalOpcode = cmd.getParams()[0] & 0xFF;
                if (originalOpcode == Constants.MESSAGE_REQUEST_ARC_INITIATION
                        || originalOpcode == Constants.MESSAGE_REQUEST_ARC_TERMINATION) {
                if (originalOpcode == Constants.MESSAGE_REQUEST_ARC_TERMINATION) {
                    disableArcTransmission();
                    finish();
                    return true;
                } else {
                    return false;
                } else if (originalOpcode == Constants.MESSAGE_REQUEST_ARC_INITIATION) {
                    tv().setArcStatus(false);
                    finish();
                    return true;
                }
                return false;
        }
        return false;
    }
+3 −3
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ final class RequestArcInitiationAction extends RequestArcAction {

    @Override
    boolean start() {
        // Seq #38
        mState = STATE_WATING_FOR_REQUEST_ARC_REQUEST_RESPONSE;
        addTimer(mState, HdmiConfig.TIMEOUT_MS);

@@ -44,9 +45,8 @@ final class RequestArcInitiationAction extends RequestArcAction {
            @Override
            public void onSendCompleted(int error) {
                if (error != Constants.SEND_RESULT_SUCCESS) {
                    // If failed to send <Request ARC Initiation>, start "Disabled"
                    // ARC transmission action.
                    disableArcTransmission();
                    // Turn off ARC status if <Request ARC Initiation> fails.
                    tv().setArcStatus(false);
                    finish();
                }
            }
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ final class SetArcTransmissionStateAction extends HdmiCecFeatureAction {

    @Override
    boolean start() {
        // Seq #37.
        if (mEnabled) {
            // Enable ARC status immediately after sending <Report Arc Initiated>.
            // If AVR responds with <Feature Abort>, disable ARC status again.