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

Commit e6942eab authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Skip transition if the display has no visible content

It is unnecessary to have a transition because there is nothing
to animate.

This aligns the same behavior as
PhysicalDisplaySwitchTransitionLauncher
   #requestDisplaySwitchTransitionIfNeeded
and DisplayContent#requestChangeTransitionIfNeeded.

Bug: 259220649
Test: atest DisplayContentDeferredUpdateTests
      Create an empty virtual display and resize it.
      There should not have a transition (it may even hit timeout).
Change-Id: I0ef1cea067d58bd54611943dc126d7e46a083d2e
parent d7c542d1
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -113,8 +113,10 @@ public class DeferredDisplayUpdater implements DisplayUpdater {

        // Apply whole display info immediately as is if either:
        // * it is the first display update
        // * the display doesn't have visible content
        // * shell transitions are disabled or temporary unavailable
        if (displayInfoDiff == DIFF_EVERYTHING
                || !mDisplayContent.getLastHasContent()
                || !mDisplayContent.mTransitionController.isShellTransitionsEnabled()) {
            ProtoLog.d(WM_DEBUG_WINDOW_TRANSITIONS,
                    "DeferredDisplayUpdater: applying DisplayInfo immediately");
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ public class DisplayContentDeferredUpdateTests extends WindowTestsBase {

    @Before
    public void before() {
        doReturn(true).when(mDisplayContent).getLastHasContent();
        mockTransitionsController(/* enabled= */ true);
        mockRemoteDisplayChangeController();
    }