From 9fec779587a425450bff021cdd8c83c3d3d3a869 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 12 Jun 2012 11:13:41 -0700 Subject: [PATCH] Do not cancel animations when switching. Was canceling ongoing animations when starting a new animation which caused the window of the first animation to restart. This looked janky. The original cancellation was put in to stop the incorrect animation being selected when quickly switching between an incoming app and the homescreen. Reversing the cancellation no longer exposes the original problem it was put in to fix. One way to duplicate what this is fixing. 1. Slow down animations to 10x. 2. Run ApiDemos/App/Alert Dialogs/List dialog 3. Tap outside the list dialog and then tap the home button. Tapping outside the list dialog causes the list dialog to animate away. Tapping the home button then causes the app to animate away. Before this fix the list dialog would revert to full size before the app animates away. With this fix the list dialog continues its original animation as the app animates away. Fixes bug 6600726. Change-Id: I29c940254808a321c3b6c2e4f4b7c78a72b47899 --- .../android/server/wm/WindowManagerService.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 28c8b06bd4cc0..5ef905af2eec6 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -3966,15 +3966,6 @@ public class WindowManagerService extends IWindowManager.Stub } } - private void cancelWindowAnimations(final AppWindowToken wtoken) { - for (int i = wtoken.windows.size() - 1; i >= 0; i--) { - final WindowStateAnimator winAnimator = wtoken.windows.get(i).mWinAnimator; - if (winAnimator.isAnimating()) { - winAnimator.clearAnimation(); - } - } - } - public void executeAppTransition() { if (!checkCallingPermission(android.Manifest.permission.MANAGE_APP_TOKENS, "executeAppTransition()")) { @@ -3990,12 +3981,6 @@ public class WindowManagerService extends IWindowManager.Stub } if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mAppTransitionReady = true; - for (int i = mOpeningApps.size() - 1; i >= 0; i--) { - cancelWindowAnimations(mOpeningApps.get(i)); - } - for (int i = mClosingApps.size() - 1; i >= 0; i--) { - cancelWindowAnimations(mClosingApps.get(i)); - } final long origId = Binder.clearCallingIdentity(); performLayoutAndPlaceSurfacesLocked(); Binder.restoreCallingIdentity(origId); @@ -4343,7 +4328,6 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_APP_TRANSITIONS) Slog.v( TAG, "Setting dummy animation on: " + wtoken); - cancelWindowAnimations(wtoken); wtoken.mAppAnimator.setDummyAnimation(); mOpeningApps.remove(wtoken); mClosingApps.remove(wtoken);