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

Commit ab06ca17 authored by wilsonshih's avatar wilsonshih
Browse files

Clear member reference AR#mStartingWindow once starting window death.

Clear the local reference of starting window once the window is death,
so it won't be reuse anywhere else.

Bug: 308334422
Test: launch test app to show splash screen then kill systemui
immediately, verify the starting window reference can be removed right
after receive binderDied.

Change-Id: Ic1b35d9a05d761e9716e3d5f603847df1d7b4d26
parent 06693f0a
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -2887,7 +2887,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }

        final StartingSurfaceController.StartingSurface surface;
        final WindowState startingWindow = mStartingWindow;
        final boolean animate;
        if (mStartingData != null) {
            if (mStartingData.mWaitForSyncTransactionCommit
@@ -4545,7 +4544,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                    mTransitionChangeFlags |= FLAG_STARTING_WINDOW_TRANSFER_RECIPIENT;
                }
                // Post cleanup after the visibility and animation are transferred.
                fromActivity.postWindowRemoveStartingWindowCleanup();
                fromActivity.postWindowRemoveStartingWindowCleanup(tStartingWindow);
                fromActivity.mVisibleSetFromTransferredStartingWindow = false;

                mWmService.updateFocusedWindowLocked(
@@ -7461,7 +7460,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
    }

    void postWindowRemoveStartingWindowCleanup() {
    void postWindowRemoveStartingWindowCleanup(@NonNull WindowState win) {
        if (mStartingWindow == win) {
            // This could only happen when the window is removed from hierarchy. So do not keep its
            // reference anymore.
            mStartingWindow = null;
        }
        if (mChildren.size() == 0 && mVisibleSetFromTransferredStartingWindow) {
            // 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
+1 −1
Original line number Diff line number Diff line
@@ -2020,7 +2020,7 @@ public class WindowManagerService extends IWindowManager.Stub
        }

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

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