From 06a94f710d4ee6366ebfbd6666c5a58916511eef Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 29 May 2012 10:46:00 -0700 Subject: [PATCH] Track animating apps up until animation starts. ActivityStack sets the mNextAppTransition value before moving the apps to their proper position. This makes the test for mNextAppTransition being TRANSITION_UNSET incorrect. Better to just look for animating. Fixes bug 6565418. Change-Id: I4651b7d3678e46fc712a8e901992fb01b94c415e --- .../com/android/server/wm/WindowManagerService.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index d9e0ec6976d00..48ceea94c28b9 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -3544,7 +3544,8 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.groupId = groupId; wtoken.appFullscreen = fullscreen; wtoken.requestedOrientation = requestedOrientation; - if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + wtoken); + if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + wtoken + + " at " + addPos); mAppTokens.add(addPos, wtoken); addAppTokenToAnimating(addPos, wtoken); mTokenMap.put(token.asBinder(), wtoken); @@ -4816,8 +4817,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET - && !mAppTransitionRunning) { + if (!mAppTransitionRunning) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, mAppTokens.size()); @@ -4836,8 +4836,7 @@ public class WindowManagerService extends IWindowManager.Stub final long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { final int N = tokens.size(); - if (N > 0 && mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET - && !mAppTransitionRunning) { + if (N > 0 && !mAppTransitionRunning) { // animating towards back, hang onto old list for duration of animation. mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); @@ -4857,8 +4856,7 @@ public class WindowManagerService extends IWindowManager.Stub } } - if (mNextAppTransition == WindowManagerPolicy.TRANSIT_UNSET - && !mAppTransitionRunning) { + if (!mAppTransitionRunning) { mAnimatingAppTokens.clear(); mAnimatingAppTokens.addAll(mAppTokens); moveAppWindowsLocked(tokens, 0);