OSDN Git Service

Do not load exit animation again if window is already animating
authorChong Zhang <chz@google.com>
Fri, 24 Jun 2016 18:23:06 +0000 (11:23 -0700)
committerChong Zhang <chz@google.com>
Fri, 24 Jun 2016 18:30:58 +0000 (11:30 -0700)
Transition can be started as soon as the entering app is drawn.
If the exiting app relayouts to invisible after transition started,
don't load the exit animation again.

bug: 29405575
Change-Id: I05ba4f733afb9426626db113be721a6bf888f093

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

index b8b7848..54960a4 100644 (file)
@@ -3003,7 +3003,8 @@ public class WindowManagerService extends IWindowManager.Stub
         if (win.mAttrs.type == TYPE_APPLICATION_STARTING) {
             transit = WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
         }
-        if (win.isWinVisibleLw() && winAnimator.applyAnimationLocked(transit, false)) {
+        if (win.isWinVisibleLw() && !winAnimator.isAnimationSet()
+                && winAnimator.applyAnimationLocked(transit, false)) {
             focusMayChange = isDefaultDisplay;
             win.mAnimatingExit = true;
             win.mWinAnimator.mAnimating = true;