Skip to content

Commit 83eaab5

Browse files
author
Craig Mautner
committed
Fix bug introduced when moving animation step out from between assignments to wasAnimating and nowAnimating.
Now wasAnimating once again contains the animation state prior to the animation step. Change-Id: I2b53bd3f62228183233ab36f0ebe44c0344d2351
1 parent 4709a11 commit 83eaab5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7685,7 +7685,7 @@ private int updateWindowsAndWallpaperLocked(final long currentTime, final int dw
76857685
}
76867686
}
76877687

7688-
final boolean wasAnimating = w.mAnimating;
7688+
final boolean wasAnimating = w.mWasAnimating;
76897689

76907690
// If the window has moved due to its containing
76917691
// content frame changing, then we'd like to animate

services/java/com/android/server/wm/WindowState.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
9191
boolean mAttachedHidden; // is our parent window hidden?
9292
boolean mLastHidden; // was this window last hidden?
9393
boolean mWallpaperVisible; // for wallpaper, what was last vis report?
94+
boolean mWasAnimating; // Were we animating going into the most recent animation step?
9495

9596
/**
9697
* The window size that was requested by the application. These are in
@@ -979,6 +980,9 @@ boolean performShowLocked() {
979980
// This must be called while inside a transaction. Returns true if
980981
// there is more animation to run.
981982
boolean stepAnimationLocked(long currentTime) {
983+
// Save the animation state as it was before this step so WindowManagerService can tell if
984+
// we just started or just stopped animating by comparing mWasAnimating with isAnimating().
985+
mWasAnimating = isAnimating();
982986
if (!mService.mDisplayFrozen && mService.mPolicy.isScreenOnFully()) {
983987
// We will run animations as long as the display isn't frozen.
984988

0 commit comments

Comments
 (0)