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

Commit cb932a9f authored by Paul Colta's avatar Paul Colta
Browse files

HDMI: Send OTT to standby if user didn't press button on Active Source loss

On active source loss pop-up button press (either Yes or Don't show
again) OTP is triggered. This OTP call cancels the delayed runnable that
will send the device to sleep. The call to assert active source is
redundant and it was removed by this patch to avoid possible regressions
(e.g. remote interference that can lead to focus stealing by the OTT).

Test: atest com.android.server.hdmi
Bug: 376496005
Flag: EXEMPT bugfix
Change-Id: Ifc1f314d200e557a8dffc88fe403f66f89e01496
parent 466d1693
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -273,13 +273,8 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
    private class DelayedStandbyOnActiveSourceLostRunnable implements Runnable {
        @Override
        public void run() {
            if (mService.getPowerManagerInternal().wasDeviceIdleFor(
                    STANDBY_AFTER_ACTIVE_SOURCE_LOST_DELAY_MS)) {
            if (!isActiveSource()) {
                mService.standby();
            } else {
                mService.setAndBroadcastActiveSource(mService.getPhysicalAddress(),
                        getDeviceInfo().getDeviceType(), Constants.ADDR_TV,
                        "DelayedActiveSourceLostStandbyRunnable");
            }
        }
    }
+7 −1
Original line number Diff line number Diff line
@@ -2562,7 +2562,13 @@ public class HdmiCecLocalDevicePlaybackTest {
        mTestLooper.dispatchAll();

        // User interacted with the DUT, so the device will not go to standby.
        skipActiveSourceLostUi(0, true, true);
        mHdmiControlService.oneTouchPlay(new IHdmiControlCallback.Stub() {
            @Override
            public void onComplete(int result) {
            }
        });
        mTestLooper.dispatchAll();

        assertThat(mIsOnActiveSourceLostPopupActive).isFalse();
        assertThat(mPowerManager.isInteractive()).isTrue();
        assertThat(mNativeWrapper.getResultMessages().contains(activeSourceFromPlayback)).isTrue();