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

Commit c76ced39 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge changes from topic "chromehole" into qt-dev

* changes:
  Only consider gone for layout if parent is gone for layout
  Reland "Prevent dismissing starting window when reopening app"
parents ed4820f0 07f7d194
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
import static com.android.server.wm.WindowManagerService.logWithStack;
import static com.android.server.wm.WindowState.LEGACY_POLICY_VISIBILITY;
import static com.android.server.wm.WindowStateAnimator.HAS_DRAWN;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_AFTER_ANIM;
import static com.android.server.wm.WindowStateAnimator.STACK_CLIP_BEFORE_ANIM;

@@ -540,6 +541,18 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                // If the app was already visible, don't reset the waitingToShow state.
                if (isHidden()) {
                    waitingToShow = true;

                    // Let's reset the draw state in order to prevent the starting window to be
                    // immediately dismissed when the app still has the surface.
                    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.
                            w.resetLastContentInsets();
                        }
                    },  true /* traverseTopToBottom */);
                }
            }

+6 −1
Original line number Diff line number Diff line
@@ -1623,7 +1623,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                || !mRelayoutCalled
                || (atoken == null && mToken.isHidden())
                || (atoken != null && atoken.hiddenRequested)
                || isParentWindowHidden()
                || isParentWindowGoneForLayout()
                || (mAnimatingExit && !isAnimatingLw())
                || mDestroying;
    }
@@ -3795,6 +3795,11 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        return parent != null && parent.mHidden;
    }

    private boolean isParentWindowGoneForLayout() {
        final WindowState parent = getParentWindow();
        return parent != null && parent.isGoneForLayoutLw();
    }

    void setWillReplaceWindow(boolean animate) {
        for (int i = mChildren.size() - 1; i >= 0; i--) {
            final WindowState c = mChildren.get(i);