Skip to content

Commit ad5725d

Browse files
author
Craig Mautner
committed
Eliminate wallpaper exposure during transition.
Make sure that the wallpaper target exists and is visible before exposing the wallpaper. Fixes bug 6570335. Change-Id: I1dddfe26683e84fd813e7bee884ba2bd4bb85272
1 parent ab886f5 commit ad5725d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,11 @@ synchronized void animate() {
489489

490490
final int N = mWinAnimators.size();
491491
for (int i = 0; i < N; i++) {
492-
mWinAnimators.get(i).prepareSurfaceLocked(true);
492+
final WindowStateAnimator winAnimator = mWinAnimators.get(i);
493+
if (winAnimator.mWin.mIsWallpaper && mService.mWallpaperTarget == null) {
494+
continue;
495+
}
496+
winAnimator.prepareSurfaceLocked(true);
493497
}
494498

495499
if (mDimParams != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8553,7 +8553,7 @@ private final void performLayoutAndPlaceSurfacesLockedInner(
85538553
handleNotObscuredLocked(w, currentTime, innerDw, innerDh);
85548554
}
85558555

8556-
if (obscuredChanged && mWallpaperTarget == w) {
8556+
if (obscuredChanged && (mWallpaperTarget == w) && w.isVisibleLw()) {
85578557
// This is the wallpaper target and its obscured state
85588558
// changed... make sure the current wallaper's visibility
85598559
// has been updated accordingly.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ void finishExit() {
381381
}
382382
if (mService.mWallpaperTarget == mWin && mService.mLowerWallpaperTarget == null) {
383383
mAnimator.hideWallpapersLocked();
384+
mAnimator.mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
384385
}
385386
}
386387

@@ -1105,8 +1106,8 @@ public void prepareSurfaceLocked(final boolean recoveringMemory) {
11051106
try {
11061107
mSurfaceAlpha = mShownAlpha;
11071108
mSurface.setAlpha(mShownAlpha);
1108-
mSurfaceLayer = w.mWinAnimator.mAnimLayer;
1109-
mSurface.setLayer(w.mWinAnimator.mAnimLayer);
1109+
mSurfaceLayer = mAnimLayer;
1110+
mSurface.setLayer(mAnimLayer);
11101111
mSurface.setMatrix(
11111112
mDsDx*w.mHScale, mDtDx*w.mVScale,
11121113
mDsDy*w.mHScale, mDtDy*w.mVScale);

0 commit comments

Comments
 (0)