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

Commit 6f4fd1cb authored by winnichang's avatar winnichang Committed by Winni Chang
Browse files

Disable ARC when system sends <Feature Abort> to <Initiate ARC>

[Description]
When the device sends an improper <Initiate ARC> command to the TV, the system will send a <Feature Abort> response to the device. The TV should then disable ARC.
bug:b/385888944

[Root Cause]
During HEACT 5-15:
1. Turn on the 5V power of the ARC port and connect the AVR.
2. Perform step 11.1.17-5, causing the physical address of the AVR to become invalid.
3. Check if ARC is disconnected (FAILED).

[Solution]
The TV needs to disable ARC when the physical address of the AVR is incorrect.

[Test Report]
HEACT 5-15 PASS.

Flag: EXEMPT bugfix
Change-Id: Iea0d57feba7d9c0a656bb4acc3e8c04df845474a
parent 59638ad7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1163,6 +1163,10 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
            if (!isConnectedToArcPort(avrDeviceInfo.getPhysicalAddress())) {
                displayOsd(OSD_MESSAGE_ARC_CONNECTED_INVALID_PORT);
            }
            if (isMessageForSystemAudio(message)) {
                Slog.e(TAG, "Disable ARC since <Feature Abort> [Initiate ARC] is sent.");
                disableArcIfExist();
            }
            return Constants.ABORT_REFUSED;
        }

+26 −0
Original line number Diff line number Diff line
@@ -775,6 +775,32 @@ public class HdmiCecLocalDeviceTvTest {
        assertThat(mHdmiCecLocalDeviceTv.isArcEstablished()).isTrue();
    }

    @Test
    public void handleInitiateArc_featureAbort_disableArc() {
        // Check the ARC initiated first
        initiateArcAndValidate();
        // Try to initiate ARC
        HdmiCecMessage initiateArc = HdmiCecMessageBuilder.buildInitiateArc(
                ADDR_AUDIO_SYSTEM,
                ADDR_TV);

        mNativeWrapper.onCecMessage(initiateArc);
        mTestLooper.dispatchAll();

        // Action: Send a Feature Abort message (simulating a response)
        HdmiCecMessage featureAbort = HdmiCecMessageBuilder.buildFeatureAbortCommand(
                Constants.ADDR_TV,
                Constants.ADDR_AUDIO_SYSTEM,
                Constants.MESSAGE_INITIATE_ARC,
                ABORT_UNRECOGNIZED_OPCODE
        );
        mNativeWrapper.onCecMessage(featureAbort);
        mTestLooper.dispatchAll();

        // Assertion: Verify that disableArcIfExist() is called which disable ARC
        assertThat(mHdmiCecLocalDeviceTv.isArcEstablished()).isFalse();
    }

    @Test
    public void handleTerminateArc_noAudioDevice() {
        HdmiCecMessage terminateArc = HdmiCecMessageBuilder.buildTerminateArc(