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

Commit 7c358744 authored by Winni Chang's avatar Winni Chang
Browse files

Fix eARC TX retransmission issue in HDMI CTS

[Description]
HDMI CTS - HFR-5-1-63 eARC TX Retransmits Basic Audio failed due to
improper system audio mode handling.

[Root Cause]
System audio mode was not correctly set when AVR device info was
unavailable, causing eARC TX retransmission failure.

[Solution]
Add checks for eARC to set system audio mode.

[Test Report]
Verify HFR5-1-63 PASS.

Flag: EXEMPT bugfix
Bug: 400616469
Change-Id: I6a606b37009e4161c0a3812b13ef0a9772345b68
parent f18970e1
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -825,8 +825,13 @@ public class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
        }
        HdmiDeviceInfo avr = getAvrDeviceInfo();
        if (avr == null) {
          if(mService.earcBlocksArcConnection()) {
                setSystemAudioMode(enabled);
                invokeCallback(callback, HdmiControlManager.RESULT_SUCCESS);
            } else {
                setSystemAudioMode(false);
                invokeCallback(callback, HdmiControlManager.RESULT_TARGET_NOT_AVAILABLE);
            }
            return;
        }

+3 −0
Original line number Diff line number Diff line
@@ -5207,6 +5207,9 @@ public class HdmiControlService extends SystemService {
        // of sound when CEC is disabled and eARC is enabled due to SAM being in the off state.
        if (!isCecControlEnabled()) {
            setSystemAudioActivated(true);
        } else if (isTvDeviceEnabled() && tv().getAvrDeviceInfo() == null) {
            // The AVR might not support CEC.
            tv().changeSystemAudioMode(enabled, null);
        }
        getAudioManager().setWiredDeviceConnectionState(attributes, enabled ? 1 : 0);
    }
+13 −0
Original line number Diff line number Diff line
@@ -1767,6 +1767,19 @@ public class HdmiCecLocalDeviceTvTest {
        assertThat(mNativeWrapper.getResultMessages()).contains(requestArcTermination);
    }

    @Test
    public void enableEarc_avrDoesNotSupportCec() {
        // Ensures that the code doesn't rely on any CEC interaction to enable system audio mode
        // when eARC is enabled.
        // Emulate Audio device on port 0x2000 (supports ARC and eARC)
        mNativeWrapper.setPortConnectionStatus(2, true);

        mHdmiControlService.setEarcEnabled(HdmiControlManager.EARC_FEATURE_ENABLED);
        mTestLooper.dispatchAll();
        assertThat(mHdmiControlService.isEarcEnabled()).isTrue();
        assertThat(mHdmiControlService.isSystemAudioActivated()).isTrue();
    }

    @Test
    public void fromArcToEarc_SamRemainsOn() {
        initateSamAndValidate();