From 2ec541fa4b19bee3e5a60245dcb504a6033cd0ac Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Tue, 12 Jun 2012 15:50:45 -0700 Subject: [PATCH] Do not hide animating window behind keyguard. The transition from clock to keyguard when restarting the device was janky. The cause was that the clock app was animating away which kept the adjustWallpaperWindowsLocked() method from setting the keyguard as the new mWallpaperTarget. At the same time the WindowAnimator saw that the keyguard was readyToDisplay() which set mForceHiding true causing the clock to become hidden. Since the clock was mWallpaperTarget the wallpaper was hidden at the same time. This fix does not allow mForceHiding to hide an animating window. Fixes bug 6649988. Change-Id: Ie5cb0dfcc987d5ee1ad2351cf520629b8e301a2b --- services/java/com/android/server/wm/WindowAnimator.java | 2 +- services/java/com/android/server/wm/WindowManagerService.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java index efed0a4a3721b..d82f6594bd65e 100644 --- a/services/java/com/android/server/wm/WindowAnimator.java +++ b/services/java/com/android/server/wm/WindowAnimator.java @@ -292,7 +292,7 @@ public class WindowAnimator { + " anim=" + win.mWinAnimator.mAnimation); } else if (mPolicy.canBeForceHidden(win, win.mAttrs)) { final boolean changed; - if (mForceHiding) { + if (mForceHiding && !winAnimator.isAnimating()) { changed = win.hideLw(false, false); if (WindowManagerService.DEBUG_VISIBILITY && changed) Slog.v(TAG, "Now policy hidden: " + win); diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 28c8b06bd4cc0..c94a3c7b87d90 100755 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -1740,8 +1740,6 @@ public class WindowManagerService extends IWindowManager.Stub mWallpaperTarget = oldW; foundW = oldW; foundI = oldI; - mLowerWallpaperTarget = null; - mUpperWallpaperTarget = null; } // Now set the upper and lower wallpaper targets // correctly, and make sure that we are positioning @@ -3162,6 +3160,7 @@ public class WindowManagerService extends IWindowManager.Stub set.addAnimation(scale); alpha.setDuration(duration); set.addAnimation(alpha); + set.setDetachWallpaper(true); a = set; } else { a = createExitAnimationLocked(transit, duration);