Merge "Reland "Prevent dismissing starting window when reopening app"" into qt-r1-dev
This commit is contained in:
@@ -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 */);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user