From 0fa77c1e0fc218040efc570936e988dbeece399c Mon Sep 17 00:00:00 2001 From: Craig Mautner Date: Mon, 11 Jun 2012 15:57:19 -0700 Subject: [PATCH] Remove over aggressive optimization. It turns out that sometimes the wallpaper target is migrated to the bottom of the window stack and then mWallpaperTarget is set to null. In particular this happens when the launcher all-apps screen is brought up. When this happens the layer of the wallpaper is correctly set below the previous wallpaper target. An optimization in WindowAnimator was keeping the layer update from propagating to the Surface object. This fix removes that optimization. Fixes bug 6631717. Change-Id: I800dd043ce8df83b4e5edbf710503135396bc01e --- .../java/com/android/server/wm/WindowAnimator.java | 10 +--------- .../com/android/server/wm/WindowStateAnimator.java | 5 ++++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java index b5cf20135bc38..efed0a4a3721b 100644 --- a/services/java/com/android/server/wm/WindowAnimator.java +++ b/services/java/com/android/server/wm/WindowAnimator.java @@ -496,15 +496,7 @@ public class WindowAnimator { final int N = mWinAnimators.size(); for (int i = 0; i < N; i++) { - final WindowStateAnimator winAnimator = mWinAnimators.get(i); - if (winAnimator.mWin.mIsWallpaper && mService.mWallpaperTarget == null) { - if (!winAnimator.mWin.mWallpaperVisible && !winAnimator.mLastHidden) { - // Wallpaper is no longer visible and there is no wp target => hide it. - winAnimator.hide(); - } - continue; - } - winAnimator.prepareSurfaceLocked(true); + mWinAnimators.get(i).prepareSurfaceLocked(true); } if (mDimParams != null) { diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java index d140aca9204a0..bdacb6e23dacd 100644 --- a/services/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/java/com/android/server/wm/WindowStateAnimator.java @@ -1063,7 +1063,10 @@ class WindowStateAnimator { setSurfaceBoundaries(recoveringMemory); - if (w.mAttachedHidden || !w.isReadyForDisplay()) { + if (mWin.mIsWallpaper && !mWin.mWallpaperVisible) { + // Wallpaper is no longer visible and there is no wp target => hide it. + hide(); + } else if (w.mAttachedHidden || !w.isReadyForDisplay()) { hide(); mAnimator.hideWallpapersLocked(w);