From ba64dfe8728318f1a0db7547d0cc3f27f3a22766 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 28 Feb 2012 12:55:58 -0800 Subject: [PATCH 1/2] debug Change-Id: I1f496bb71068b6c3a09095c39fb04c9f4153e051 --- .../java/com/android/server/wm/WindowManagerService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 96142a1bb29e8..babed3441b284 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -146,7 +146,7 @@ public class WindowManagerService extends IWindowManager.Stub static final String TAG = "WindowManager"; static final boolean DEBUG = false; static final boolean DEBUG_ADD_REMOVE = false; - static final boolean DEBUG_FOCUS = false; + static final boolean DEBUG_FOCUS = true; static final boolean DEBUG_ANIM = false; static final boolean DEBUG_LAYOUT = false; static final boolean DEBUG_RESIZE = false; @@ -162,13 +162,13 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_APP_TRANSITIONS = false; static final boolean DEBUG_STARTING_WINDOW = false; static final boolean DEBUG_REORDER = false; - static final boolean DEBUG_WALLPAPER = false; + static final boolean DEBUG_WALLPAPER = true; static final boolean DEBUG_DRAG = false; static final boolean DEBUG_SCREEN_ON = false; static final boolean DEBUG_SCREENSHOT = false; static final boolean DEBUG_BOOT = false; static final boolean SHOW_SURFACE_ALLOC = false; - static final boolean SHOW_TRANSACTIONS = false; + static final boolean SHOW_TRANSACTIONS = true; static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS; static final boolean HIDE_STACK_CRAWLS = true; From 343511c9ec6a7a1d3760f784824a64e732f3b7a2 Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 28 Feb 2012 17:30:50 -0800 Subject: [PATCH 2/2] Detect animation completions like we used to. Previous approximations weren't indicating completion and windows weren't being layered correctly as a result. Change-Id: I08fcd278485bb87dc10bca257b9f8073108753f3 --- .../android/server/wm/WindowManagerService.java | 17 ++++++++++------- .../java/com/android/server/wm/WindowState.java | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index babed3441b284..008793c453bb0 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -146,7 +146,7 @@ public class WindowManagerService extends IWindowManager.Stub static final String TAG = "WindowManager"; static final boolean DEBUG = false; static final boolean DEBUG_ADD_REMOVE = false; - static final boolean DEBUG_FOCUS = true; + static final boolean DEBUG_FOCUS = false; static final boolean DEBUG_ANIM = false; static final boolean DEBUG_LAYOUT = false; static final boolean DEBUG_RESIZE = false; @@ -162,13 +162,13 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_APP_TRANSITIONS = false; static final boolean DEBUG_STARTING_WINDOW = false; static final boolean DEBUG_REORDER = false; - static final boolean DEBUG_WALLPAPER = true; + static final boolean DEBUG_WALLPAPER = false; static final boolean DEBUG_DRAG = false; static final boolean DEBUG_SCREEN_ON = false; static final boolean DEBUG_SCREENSHOT = false; static final boolean DEBUG_BOOT = false; static final boolean SHOW_SURFACE_ALLOC = false; - static final boolean SHOW_TRANSACTIONS = true; + static final boolean SHOW_TRANSACTIONS = false; static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS; static final boolean HIDE_STACK_CRAWLS = true; @@ -7685,8 +7685,6 @@ public class WindowManagerService extends IWindowManager.Stub } } - final boolean wasAnimating = w.mWasAnimating; - // If the window has moved due to its containing // content frame changing, then we'd like to animate // it. The checks here are ordered by what is least @@ -7705,8 +7703,13 @@ public class WindowManagerService extends IWindowManager.Stub w.mAnimDh = innerDh; } - // Execute animation. - final boolean nowAnimating = w.isAnimating(); + final boolean wasAnimating = w.mWasAnimating; + final boolean nowAnimating = w.mLocalAnimating; + + if (DEBUG_WALLPAPER) { + Slog.v(TAG, w + ": wasAnimating=" + wasAnimating + + ", nowAnimating=" + nowAnimating); + } // If this window is animating, make a note that we have // an animating window and take care of a request to run diff --git a/services/java/com/android/server/wm/WindowState.java b/services/java/com/android/server/wm/WindowState.java index fc435f71b4823..eeecad1da205d 100644 --- a/services/java/com/android/server/wm/WindowState.java +++ b/services/java/com/android/server/wm/WindowState.java @@ -982,7 +982,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { boolean stepAnimationLocked(long currentTime) { // Save the animation state as it was before this step so WindowManagerService can tell if // we just started or just stopped animating by comparing mWasAnimating with isAnimating(). - mWasAnimating = isAnimating(); + mWasAnimating = mAnimating; if (!mService.mDisplayFrozen && mService.mPolicy.isScreenOnFully()) { // We will run animations as long as the display isn't frozen.