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

Commit 0e87891a authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove waitingToShow of WindowToken

Except shell transition does not use the state, legacy transition
also doesn't need it because the condition mToken.isVisible()
already has the same meaning. The isVisible() will be true for a
visible-requested app when the transition is ready to commit the
visibility. And it is false if there is a transition which is not
ready yet.

Bug: 163976519
Test: CtsWindowManagerDeviceActivity
Change-Id: I649c3f673dfa2f8a9ef90f0f1b3fd21ff0030587
parent b017819a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ message WindowTokenProto {
    optional WindowContainerProto window_container = 1;
    optional int32 hash_code = 2;
    repeated WindowStateProto windows = 3 [deprecated=true];
    optional bool waiting_to_show = 5;
    optional bool waiting_to_show = 5 [deprecated=true];
    optional bool paused = 6;
}

+10 −21
Original line number Diff line number Diff line
@@ -4327,7 +4327,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        mTaskSupervisor.getActivityMetricsLogger().notifyActivityRemoved(this);
        mTaskSupervisor.mStoppingActivities.remove(this);
        mLetterboxUiController.destroy();
        waitingToShow = false;

        // Defer removal of this activity when either a child is animating, or app transition is on
        // going. App transition animation might be applied on the parent task not on the activity,
@@ -5401,7 +5400,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        final DisplayContent displayContent = getDisplayContent();
        displayContent.mOpeningApps.remove(this);
        displayContent.mClosingApps.remove(this);
        waitingToShow = false;
        setVisibleRequested(visible);
        mLastDeferHidingClient = deferHidingClient;

@@ -5426,27 +5424,18 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
            // stopped, then we need to set up to wait for its windows to be ready.
            if (!isVisible() || mAppStopped) {
                clearAllDrawn();

                // If the app was already visible, don't reset the waitingToShow state.
                if (!isVisible()) {
                    waitingToShow = true;

                    // If the client isn't hidden, we don't need to reset the drawing state.
                    if (!isClientVisible()) {
                        // Let's reset the draw state in order to prevent the starting window to be
                        // immediately dismissed when the app still has the surface.
                // Reset the draw state in order to prevent the starting window to be immediately
                // dismissed when the app still has the surface.
                if (!isVisible() && !isClientVisible()) {
                    forAllWindows(w -> {
                        if (w.mWinAnimator.mDrawState == HAS_DRAWN) {
                            w.mWinAnimator.resetDrawState();

                                // Force add to mResizingWindows, so that we are guaranteed to get
                                // another reportDrawn callback.
                            // Force add to mResizingWindows, so the window will report drawn.
                            w.forceReportingResized();
                        }
                    }, true /* traverseTopToBottom */);
                }
            }
            }

            // In the case where we are making an app visible but holding off for a transition,
            // we still need to tell the client to make its windows visible so they get drawn.
+0 −1
Original line number Diff line number Diff line
@@ -1176,7 +1176,6 @@ public class AppTransitionController {
                mDisplayContent.mNoAnimationNotifyOnTransitionFinished.add(app.token);
            }
            app.updateReportedVisibilityLocked();
            app.waitingToShow = false;
            app.showAllWindowsLocked();

            if (mDisplayContent.mAppTransition.isNextAppTransitionThumbnailUp()) {
+0 −1
Original line number Diff line number Diff line
@@ -1906,7 +1906,6 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        for (int i = mParticipants.size() - 1; i >= 0; --i) {
            final WallpaperWindowToken wallpaper = mParticipants.valueAt(i).asWallpaperToken();
            if (wallpaper != null) {
                wallpaper.waitingToShow = false;
                if (!wallpaper.isVisible() && wallpaper.isVisibleRequested()) {
                    wallpaper.commitVisibility(showWallpaper);
                }
+0 −3
Original line number Diff line number Diff line
@@ -1929,9 +1929,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
     * of a transition that has not yet been started.
     */
    boolean isReadyForDisplay() {
        if (mToken.waitingToShow && getDisplayContent().mAppTransition.isTransitionSet()) {
            return false;
        }
        final boolean parentAndClientVisible = !isParentWindowHidden()
                && mViewVisibility == View.VISIBLE && mToken.isVisible();
        return mHasSurface && isVisibleByPolicy() && !mDestroying
Loading