diff options
| author | 2015-06-04 17:30:05 +0000 | |
|---|---|---|
| committer | 2015-06-04 17:30:05 +0000 | |
| commit | a1b35394b69145fe0a08eebb9d71ff8d54a4fca9 (patch) | |
| tree | 137663bd6b5b7d9c19da055ad1dc1c52af76ed28 | |
| parent | 2e4e5d745f6e2bc2d9d63b25a45385b55ec4cfe3 (diff) | |
| parent | 79f4718d7cb7e4a7b43dff9618bd4edd884ed6de (diff) | |
Merge "Don't leak windows on removal with dummy animations" into mnc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 9 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowStateAnimator.java | 12 |
2 files changed, 16 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 70194530bb44..6b5c224af220 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2734,14 +2734,16 @@ public class WindowManagerService extends IWindowManager.Stub } } final AppWindowToken appToken = win.mAppToken; + // Prevent an immediate window exit only for a real animation, ignoring e.g. + // dummy animations. + final boolean inAnimation = win.mWinAnimator.isWindowAnimatingNow(); // The starting window is the last window in this app token and it isn't animating. // Allow it to be removed now as there is no additional window or animation that will // trigger its removal. final boolean lastWinStartingNotAnimating = startingWindow && appToken!= null - && appToken.allAppWindows.size() == 1 && !win.mWinAnimator.isWindowAnimating(); - if (!lastWinStartingNotAnimating && (win.mExiting || win.mWinAnimator.isAnimating())) { + && appToken.allAppWindows.size() == 1 && !inAnimation; + if (!lastWinStartingNotAnimating && (win.mExiting || inAnimation)) { // The exit animation is running... wait for it! - //Slog.i(TAG, "*** Running exit animation..."); win.mExiting = true; win.mRemoveOnExit = true; final DisplayContent displayContent = win.getDisplayContent(); @@ -2757,7 +2759,6 @@ public class WindowManagerService extends IWindowManager.Stub if (focusChanged) { mInputMonitor.updateInputWindowsLw(false /*force*/); } - //dump(); Binder.restoreCallingIdentity(origId); return; } diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index e9023fda17a0..b42c8ebe76ef 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -251,11 +251,21 @@ class WindowStateAnimator { && mAppAnimator.animation == AppWindowAnimator.sDummyAnimation; } - /** Is this window currently animating? */ + /** Is this window currently set to animate or currently animating? + * NOTE: The method will return true for cases where the window isn't currently animating, but + * is set to animate. i.e. if the window animation is currently set to a dummy placeholder + * animation. Use {@link #isWindowAnimatingNow} to know if the window is currently running a + * real animation. */ boolean isWindowAnimating() { return mAnimation != null; } + /** Is the window performing a real animation and not a dummy which is only waiting for an + * an animation to start? */ + boolean isWindowAnimatingNow() { + return isWindowAnimating() && !isDummyAnimation(); + } + void cancelExitAnimationForNextAnimationLocked() { if (mAnimation != null) { mAnimation.cancel(); |