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

Commit 659a42df authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix ActivityRecord leak if mainWindow is animating." into sc-dev

parents 02a92fb4 5e49e12b
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -2409,18 +2409,22 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING;
        final boolean startingWindow = mAttrs.type == TYPE_APPLICATION_STARTING;
        if (startingWindow) {
        if (startingWindow) {
            ProtoLog.d(WM_DEBUG_STARTING_WINDOW, "Starting window removed %s", this);
            ProtoLog.d(WM_DEBUG_STARTING_WINDOW, "Starting window removed %s", this);
        }

        if (startingWindow && StartingSurfaceController.DEBUG_ENABLE_SHELL_DRAWER) {
            // Cancel the remove starting window animation on shell. The main window might changed
            // Cancel the remove starting window animation on shell. The main window might changed
            // during animating, checking for all windows would be safer.
            // during animating, checking for all windows would be safer.
            if (mActivityRecord != null) {
            if (mActivityRecord != null) {
                mActivityRecord.forAllWindows(w -> {
                mActivityRecord.forAllWindowsUnchecked(w -> {
                    if (w.isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
                    if (w.isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
                        w.cancelAnimation();
                        w.cancelAnimation();
                        return true;
                    }
                    }
                    return false;
                }, true);
                }, true);
            }
            }
        } else if (mAttrs.type == TYPE_BASE_APPLICATION
                && isSelfAnimating(0, ANIMATION_TYPE_STARTING_REVEAL)) {
            // Cancel the remove starting window animation in case the binder dead before remove
            // splash window.
            cancelAnimation();
        }
        }


        ProtoLog.v(WM_DEBUG_FOCUS, "Remove client=%x, surfaceController=%s Callers=%s",
        ProtoLog.v(WM_DEBUG_FOCUS, "Remove client=%x, surfaceController=%s Callers=%s",
@@ -2428,7 +2432,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                    mWinAnimator.mSurfaceController,
                    mWinAnimator.mSurfaceController,
                    Debug.getCallers(5));
                    Debug.getCallers(5));



        final long origId = Binder.clearCallingIdentity();
        final long origId = Binder.clearCallingIdentity();


        try {
        try {