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

Commit 9cbf12ec authored by wilsonshih's avatar wilsonshih Committed by Wei Sheng Shih
Browse files

Clean up postWindowRemoveStartingWindowCleanUp

The starting window will be remove automatically when activity died,
so there doesn't need check whether the activity need to remove
starting window when a window gone.
When the client process killed during launch, the core can keep
starting window on screen since there will restart the process with
original activity, so doesn't need to remove starting window.

Bug: 280516527
Test: verify no regression for 156298440
Test: simulate to kill top app process while launch app, and verify no
flickering occur.

Change-Id: If85386e963d7cca0dad9a143d6de0e7cd87b05f0
parent e2276458
Loading
Loading
Loading
Loading
+7 −22
Original line number Original line Diff line number Diff line
@@ -4530,7 +4530,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    mTransitionChangeFlags |= FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
                    mTransitionChangeFlags |= FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
                }
                }
                // Post cleanup after the visibility and animation are transferred.
                // Post cleanup after the visibility and animation are transferred.
                fromActivity.postWindowRemoveStartingWindowCleanup(tStartingWindow);
                fromActivity.postWindowRemoveStartingWindowCleanup();
                fromActivity.mVisibleSetFromTransferredStartingWindow = false;
                fromActivity.mVisibleSetFromTransferredStartingWindow = false;


                mWmService.updateFocusedWindowLocked(
                mWmService.updateFocusedWindowLocked(
@@ -7450,28 +7450,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        }
    }
    }


    void postWindowRemoveStartingWindowCleanup(WindowState win) {
    void postWindowRemoveStartingWindowCleanup() {
        // TODO: Something smells about the code below...Is there a better way?
        if (mChildren.size() == 0 && mVisibleSetFromTransferredStartingWindow) {
        if (mStartingWindow == win) {
            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Notify removed startingWindow %s", win);
            removeStartingWindow();
        } else if (mChildren.size() == 0) {
            // If this is the last window and we had requested a starting transition window,
            // well there is no point now.
            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Nulling last startingData");
            mStartingData = null;
            if (mVisibleSetFromTransferredStartingWindow) {
            // We set the visible state to true for the token from a transferred starting
            // We set the visible state to true for the token from a transferred starting
            // window. We now reset it back to false since the starting window was the last
            // window. We now reset it back to false since the starting window was the last
            // window in the token.
            // window in the token.
            setVisible(false);
            setVisible(false);
        }
        }
        } else if (mChildren.size() == 1 && mStartingSurface != null && !isRelaunching()) {
            // If this is the last window except for a starting transition window,
            // we need to get rid of the starting transition.
            ProtoLog.v(WM_DEBUG_STARTING_WINDOW, "Last window, removing starting window %s", win);
            removeStartingWindow();
        }
    }
    }


    void requestUpdateWallpaperIfNeeded() {
    void requestUpdateWallpaperIfNeeded() {
+1 −1
Original line number Original line Diff line number Diff line
@@ -2020,7 +2020,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }
        }


        if (win.mActivityRecord != null) {
        if (win.mActivityRecord != null) {
            win.mActivityRecord.postWindowRemoveStartingWindowCleanup(win);
            win.mActivityRecord.postWindowRemoveStartingWindowCleanup();
        }
        }


        if (win.mAttrs.type == TYPE_WALLPAPER) {
        if (win.mAttrs.type == TYPE_WALLPAPER) {