diff options
author | Craig Mautner <cmautner@google.com> | 2013-03-28 15:28:55 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2013-04-05 10:26:19 -0700 |
commit | 4238e3e4b5edbd7e28d0d929ac0c4fdbecd7b100 (patch) | |
tree | 3d5895891d8e28890e9291022f4502870908ba3c | |
parent | 63fba8c12e3cf3e1fba39d9b76e230e25f98953c (diff) | |
download | frameworks_base-4238e3e4b5edbd7e28d0d929ac0c4fdbecd7b100.zip frameworks_base-4238e3e4b5edbd7e28d0d929ac0c4fdbecd7b100.tar.gz frameworks_base-4238e3e4b5edbd7e28d0d929ac0c4fdbecd7b100.tar.bz2 |
Make the min layer go down through all windows
The min layer was set to only show the windows that matched
the specified app token. But that meant when dialogs were
launched it only showed the dialogs and not the background
windows.
Added improved debugging.
fixes bug 8502844.
Change-Id: I26b49568b872801ec9aa088df20317aa752dacd6
-rw-r--r-- | services/java/com/android/server/wm/WindowManagerService.java | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java index 34052f3..3c40238 100644 --- a/services/java/com/android/server/wm/WindowManagerService.java +++ b/services/java/com/android/server/wm/WindowManagerService.java @@ -5365,6 +5365,9 @@ public class WindowManagerService extends IWindowManager.Stub if (maxLayer < winAnim.mSurfaceLayer) { maxLayer = winAnim.mSurfaceLayer; } + if (minLayer > winAnim.mSurfaceLayer) { + minLayer = winAnim.mSurfaceLayer; + } // Don't include wallpaper in bounds calculation if (!ws.mIsWallpaper) { @@ -5377,17 +5380,14 @@ public class WindowManagerService extends IWindowManager.Stub frame.union(left, top, right, bottom); } - if (ws.mAppToken != null && ws.mAppToken.token == appToken) { - if (minLayer > ws.mWinAnimator.mSurfaceLayer) { - minLayer = ws.mWinAnimator.mSurfaceLayer; - } - if (ws.isDisplayedLw()) { - screenshotReady = true; - } - if (fullscreen) { - // No point in continuing down through windows. - break; - } + if (ws.mAppToken != null && ws.mAppToken.token == appToken && + ws.isDisplayedLw()) { + screenshotReady = true; + } + + if (fullscreen) { + // No point in continuing down through windows. + break; } } @@ -5461,14 +5461,12 @@ public class WindowManagerService extends IWindowManager.Stub rawss = SurfaceControl.screenshot(dw, dh, minLayer, maxLayer); } } while (!screenshotReady && retryCount <= MAX_SCREENSHOT_RETRIES); - if (DEBUG_SCREENSHOT && retryCount > MAX_SCREENSHOT_RETRIES) { - Slog.i(TAG, "Screenshot max retries " + retryCount + " of " + appToken + " appWin=" - + (appWin == null ? "null" : (appWin + " drawState=" - + appWin.mWinAnimator.mDrawState))); - } + if (retryCount > MAX_SCREENSHOT_RETRIES) Slog.i(TAG, "Screenshot max retries " + + retryCount + " of " + appToken + " appWin=" + (appWin == null ? + "null" : (appWin + " drawState=" + appWin.mWinAnimator.mDrawState))); if (rawss == null) { - Slog.w(TAG, "Failure taking screenshot for (" + dw + "x" + dh + Slog.w(TAG, "Screenshot failure taking screenshot for (" + dw + "x" + dh + ") to layer " + maxLayer); return null; } @@ -5481,7 +5479,7 @@ public class WindowManagerService extends IWindowManager.Stub canvas.drawBitmap(rawss, matrix, null); canvas.setBitmap(null); - if (DEBUG_SCREENSHOT) { + if (true || DEBUG_SCREENSHOT) { // TEST IF IT's ALL BLACK int[] buffer = new int[bm.getWidth() * bm.getHeight()]; bm.getPixels(buffer, 0, bm.getWidth(), 0, 0, bm.getWidth(), bm.getHeight()); @@ -5494,7 +5492,8 @@ public class WindowManagerService extends IWindowManager.Stub } if (allBlack) { Slog.i(TAG, "Screenshot " + appWin + " was all black! mSurfaceLayer=" + - (appWin != null ? appWin.mWinAnimator.mSurfaceLayer : "null")); + (appWin != null ? appWin.mWinAnimator.mSurfaceLayer : "null") + + " minLayer=" + minLayer + " maxLayer=" + maxLayer); } } |