Skip to content

Commit 0fa77c1

Browse files
author
Craig Mautner
committed
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
1 parent c38869a commit 0fa77c1

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

services/java/com/android/server/wm/WindowAnimator.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,7 @@ synchronized void animate() {
496496

497497
final int N = mWinAnimators.size();
498498
for (int i = 0; i < N; i++) {
499-
final WindowStateAnimator winAnimator = mWinAnimators.get(i);
500-
if (winAnimator.mWin.mIsWallpaper && mService.mWallpaperTarget == null) {
501-
if (!winAnimator.mWin.mWallpaperVisible && !winAnimator.mLastHidden) {
502-
// Wallpaper is no longer visible and there is no wp target => hide it.
503-
winAnimator.hide();
504-
}
505-
continue;
506-
}
507-
winAnimator.prepareSurfaceLocked(true);
499+
mWinAnimators.get(i).prepareSurfaceLocked(true);
508500
}
509501

510502
if (mDimParams != null) {

services/java/com/android/server/wm/WindowStateAnimator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,10 @@ public void prepareSurfaceLocked(final boolean recoveringMemory) {
10631063

10641064
setSurfaceBoundaries(recoveringMemory);
10651065

1066-
if (w.mAttachedHidden || !w.isReadyForDisplay()) {
1066+
if (mWin.mIsWallpaper && !mWin.mWallpaperVisible) {
1067+
// Wallpaper is no longer visible and there is no wp target => hide it.
1068+
hide();
1069+
} else if (w.mAttachedHidden || !w.isReadyForDisplay()) {
10671070
hide();
10681071
mAnimator.hideWallpapersLocked(w);
10691072

0 commit comments

Comments
 (0)