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

Commit 44ec84a5 authored by Winni Chang's avatar Winni Chang Committed by Android (Google) Code Review
Browse files

Merge "Fix eARC TX retransmission issue in HDMI CTS" into main

parents a2e00828 7c358744
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();