Correctly prevent entrance animation for replacing windows.

Prevention of entrance animation for seamlessly replacing windows,
was not working for non child windows. To correct it, we simply bail
from applying the app entrance transition.

Bug: 26668339
Change-Id: I4349e6aef55c3957d81a0a168cf6ac1d7c8866f1
This commit is contained in:
Robert Carr
2016-04-07 22:52:10 -07:00
parent d1a010f279
commit b439a63fdf
3 changed files with 16 additions and 0 deletions

View File

@@ -541,6 +541,7 @@ class AppWindowToken extends WindowToken {
if (candidate.mWillReplaceWindow && candidate.mReplacingWindow == null &&
candidate.getWindowTag().equals(w.getWindowTag().toString())) {
candidate.mReplacingWindow = w;
w.mSkipEnterAnimationForSeamlessReplacement = !candidate.mAnimateReplacingWindow;
// if we got a replacement window, reset the timeout to give drawing more time
service.mH.removeMessages(H.WINDOW_REPLACEMENT_TIMEOUT);
@@ -575,6 +576,9 @@ class AppWindowToken extends WindowToken {
continue;
}
candidate.mWillReplaceWindow = false;
if (candidate.mReplacingWindow != null) {
candidate.mReplacingWindow.mSkipEnterAnimationForSeamlessReplacement = false;
}
// Since the window already timed out, remove it immediately now.
// Use removeWindowInnerLocked() instead of removeWindowLocked(), as the latter
// delays removal on certain conditions, which will leave the stale window in the

View File

@@ -445,6 +445,11 @@ final class WindowState implements WindowManagerPolicy.WindowState {
// If not null, the window that will be used to replace the old one. This is being set when
// the window is added and unset when this window reports its first draw.
WindowState mReplacingWindow = null;
// For the new window in the replacement transition, if we have
// requested to replace without animation, then we should
// make sure we also don't apply an enter animation for
// the new window.
boolean mSkipEnterAnimationForSeamlessReplacement = false;
// Whether this window is being moved via the resize API
boolean mMovedByResize;
@@ -1574,6 +1579,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
win.mAnimateReplacingWindow = false;
win.mReplacingRemoveRequested = false;
win.mReplacingWindow = null;
mSkipEnterAnimationForSeamlessReplacement = false;
if (win.mAnimatingExit) {
mService.removeWindowInnerLocked(win);
}

View File

@@ -1661,6 +1661,12 @@ class WindowStateAnimator {
}
void applyEnterAnimationLocked() {
// If we are the new part of a window replacement transition and we have requested
// not to animate, we instead want to make it seamless, so we don't want to apply
// an enter transition.
if (mWin.mSkipEnterAnimationForSeamlessReplacement) {
return;
}
final int transit;
if (mEnterAnimationPending) {
mEnterAnimationPending = false;