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

Commit 16cb9fc1 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Merge "Reland "Prevent dismissing starting window when reopening app"" into...

Merge "Reland "Prevent dismissing starting window when reopening app"" into qt-r1-dev am: e0094cb1
am: ee9e0371

Change-Id: I2e3998194c82bf9bba8cf870c1b8758a9f44bde0
parents 29a290d7 ee9e0371
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 */);
                }
            }