diff options
| author | 2016-02-19 19:33:26 -0800 | |
|---|---|---|
| committer | 2016-02-22 16:17:46 -0500 | |
| commit | 02b74b9420f0b4adbec6997b950e244ad0dff56c (patch) | |
| tree | 2801bdb74604056ee505725b47a909fd9ad9df5d | |
| parent | 1fd5f379d724cc673a37d52b977e67d82451343a (diff) | |
Fix leaking animation
Clear animation when destroying window surface.
Because we are not stepping in animations for windows if they don't
have a surface, we can't use it as a detached wallpaper target
animation.
When the surface was destroyed while animating,
winAnimator.mAnimating was still true, and never got false, because
we didn't call stepAnimation on the WindowAnimator anymore.
Thus, we were constantly animating, using a lot of battery (surface
flinger was constantly pushing frames) and impacting overall system
performance.
Bug: 27276043
Change-Id: I8b0943da0908c85740dc1113aedb573fb440f162
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowAnimator.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/WindowAnimator.java b/services/core/java/com/android/server/wm/WindowAnimator.java index 38d0711e42b3..85bddee5e1dc 100644 --- a/services/core/java/com/android/server/wm/WindowAnimator.java +++ b/services/core/java/com/android/server/wm/WindowAnimator.java @@ -530,7 +530,7 @@ public class WindowAnimator { for (int i = windows.size() - 1; i >= 0; i--) { final WindowState win = windows.get(i); WindowStateAnimator winAnimator = win.mWinAnimator; - if (winAnimator.mSurfaceController == null) { + if (winAnimator.mSurfaceController == null || !winAnimator.hasSurface()) { continue; } |