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

Commit d4b83f96 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Don't remove starting window for visible app." into oc-dr1-dev

parents 2a8a58ea 2c596d57
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2184,7 +2184,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        if (mStartingWindowState == STARTING_WINDOW_SHOWN && behindFullscreenActivity) {
            if (DEBUG_VISIBILITY) Slog.w(TAG_VISIBILITY, "Found orphaned starting window " + this);
            mStartingWindowState = STARTING_WINDOW_REMOVED;
            mWindowContainerController.removeStartingWindow();
            mWindowContainerController.removeHiddenStartingWindow();
        }
    }

+17 −1
Original line number Diff line number Diff line
@@ -647,7 +647,23 @@ public class AppWindowContainerController
        return mContainer.getTask().getConfiguration().orientation == snapshot.getOrientation();
    }

    public void removeStartingWindow() {
    /**
     * Remove starting window if the app is currently hidden. It is possible the starting window is
     * part of its app exit transition animation in which case we delay hiding the app token. The
     * method allows for removal when window manager has set the app token to hidden.
     */
    public void removeHiddenStartingWindow() {
        synchronized (mWindowMap) {
            if (!mContainer.hidden) {
                if (DEBUG_STARTING_WINDOW) Slog.v(TAG_WM, "Starting window app still visible."
                        + " Ignoring remove request.");
                return;
            }
            removeStartingWindow();
        }
    }

    void removeStartingWindow() {
        synchronized (mWindowMap) {
            if (mHandler.hasCallbacks(mRemoveStartingWindow)) {
                // Already scheduled.
+8 −3
Original line number Diff line number Diff line
@@ -441,6 +441,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                    mChildren.get(i).mWinAnimator.hide("immediately hidden");
                }
                SurfaceControl.closeTransaction();
                removeStartingWindow();
            }

            if (!mService.mClosingApps.contains(this) && !mService.mOpeningApps.contains(this)) {
@@ -518,6 +519,12 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        return super.checkCompleteDeferredRemoval();
    }

    private void removeStartingWindow() {
        if (startingData != null && getController() != null) {
            getController().removeStartingWindow();
        }
    }

    void onRemovedFromDisplay() {
        if (mRemovingFromDisplay) {
            return;
@@ -545,9 +552,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG_WM, "removeAppToken: "
                + this + " delayed=" + delayed + " Callers=" + Debug.getCallers(4));

        if (startingData != null && getController() != null) {
            getController().removeStartingWindow();
        }
        removeStartingWindow();

        // If this window was animating, then we need to ensure that the app transition notifies
        // that animations have completed in WMS.handleAnimatingStoppedAndTransitionLocked(), so