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

Commit 46332a8e authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unnecessary wallpaper adjustment on transition

Since WallpaperController won't change wallpaper target if the
closing target is in transition, the adjustWallpaperWindows
won't change any state when transition is ready but spend the
time to traverse.

The entry points from AR#setVisibility->requestUpdateWallpaperIfNeeded
and transition finish->commitVisibility->postApplyAnimation
->FINISH_LAYOUT_REDO_WALLPAPER are already enough to update.

Bug: 258880446
Test: WallpaperControllerTests
Change-Id: I6b48099c455c2987c74b31b9d6d7d06d484a7c56
parent 020a6ef4
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -911,13 +911,6 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
            mOverrideOptions = null;
            mOverrideOptions = null;
            return;
            return;
        }
        }
        // Ensure that wallpaper visibility is updated with the latest wallpaper target.
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
            final WindowContainer<?> wc = mParticipants.valueAt(i);
            if (isWallpaper(wc) && wc.getDisplayContent() != null) {
                wc.getDisplayContent().mWallpaperController.adjustWallpaperWindows();
            }
        }


        mState = STATE_PLAYING;
        mState = STATE_PLAYING;
        mStartTransaction = transaction;
        mStartTransaction = transaction;
+0 −9
Original line number Original line Diff line number Diff line
@@ -372,15 +372,6 @@ public class WallpaperControllerTests extends WindowTestsBase {
        dc.mTransitionController.finishTransition(transit);
        dc.mTransitionController.finishTransition(transit);
        assertFalse(wallpaperWindow.isVisible());
        assertFalse(wallpaperWindow.isVisible());
        assertFalse(token.isVisible());
        assertFalse(token.isVisible());

        // Assume wallpaper was visible. When transaction is ready without wallpaper target,
        // wallpaper should be requested to be invisible.
        token.setVisibility(true);
        transit = dc.mTransitionController.createTransition(TRANSIT_CLOSE);
        dc.mTransitionController.collect(token);
        transit.onTransactionReady(transit.getSyncId(), t);
        assertFalse(token.isVisibleRequested());
        assertTrue(token.isVisible());
    }
    }


    private static void prepareSmallerSecondDisplay(DisplayContent dc, int width, int height) {
    private static void prepareSmallerSecondDisplay(DisplayContent dc, int width, int height) {