Loading services/core/java/com/android/server/wm/WindowManagerService.java +136 −158 Original line number Diff line number Diff line Loading @@ -6024,7 +6024,6 @@ public class WindowManagerService extends IWindowManager.Stub minLayer = Integer.MAX_VALUE; } int retryCount = 0; WindowState appWin = null; boolean appIsImTarget; Loading @@ -6038,17 +6037,6 @@ public class WindowManagerService extends IWindowManager.Stub final int aboveAppLayer = (mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) + 1) * TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET; while (true) { if (retryCount++ > 0) { // Reset max/min layers on retries so we don't accidentally take a screenshot of a // layer based on the previous try. maxLayer = 0; minLayer = Integer.MAX_VALUE; try { Thread.sleep(100); } catch (InterruptedException e) { } } synchronized(mWindowMap) { // Figure out the part of the screen that is actually the app. appWin = null; Loading Loading @@ -6131,19 +6119,12 @@ public class WindowManagerService extends IWindowManager.Stub } if (!screenshotReady) { if (retryCount > MAX_SCREENSHOT_RETRIES) { Slog.i(TAG_WM, "Screenshot max retries " + retryCount + " of " + appToken + Slog.i(TAG_WM, "Failed to capture screenshot of " + appToken + " appWin=" + (appWin == null ? "null" : (appWin + " drawState=" + appWin.mWinAnimator.mDrawState))); return null; } // Delay and hope that window gets drawn. if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot: No image ready for " + appToken + ", " + appWin + " drawState=" + appWin.mWinAnimator.mDrawState); continue; } // Screenshot is ready to be taken. Everything from here below will continue // through the bottom of the loop and return a value. We only stay in the loop // because we don't want to release the mWindowMap lock until the screenshot is Loading Loading @@ -6224,9 +6205,6 @@ public class WindowManagerService extends IWindowManager.Stub } } break; } if (DEBUG_SCREENSHOT) { // TEST IF IT's ALL BLACK int[] buffer = new int[bm.getWidth() * bm.getHeight()]; Loading Loading
services/core/java/com/android/server/wm/WindowManagerService.java +136 −158 Original line number Diff line number Diff line Loading @@ -6024,7 +6024,6 @@ public class WindowManagerService extends IWindowManager.Stub minLayer = Integer.MAX_VALUE; } int retryCount = 0; WindowState appWin = null; boolean appIsImTarget; Loading @@ -6038,17 +6037,6 @@ public class WindowManagerService extends IWindowManager.Stub final int aboveAppLayer = (mPolicy.windowTypeToLayerLw(TYPE_APPLICATION) + 1) * TYPE_LAYER_MULTIPLIER + TYPE_LAYER_OFFSET; while (true) { if (retryCount++ > 0) { // Reset max/min layers on retries so we don't accidentally take a screenshot of a // layer based on the previous try. maxLayer = 0; minLayer = Integer.MAX_VALUE; try { Thread.sleep(100); } catch (InterruptedException e) { } } synchronized(mWindowMap) { // Figure out the part of the screen that is actually the app. appWin = null; Loading Loading @@ -6131,19 +6119,12 @@ public class WindowManagerService extends IWindowManager.Stub } if (!screenshotReady) { if (retryCount > MAX_SCREENSHOT_RETRIES) { Slog.i(TAG_WM, "Screenshot max retries " + retryCount + " of " + appToken + Slog.i(TAG_WM, "Failed to capture screenshot of " + appToken + " appWin=" + (appWin == null ? "null" : (appWin + " drawState=" + appWin.mWinAnimator.mDrawState))); return null; } // Delay and hope that window gets drawn. if (DEBUG_SCREENSHOT) Slog.i(TAG_WM, "Screenshot: No image ready for " + appToken + ", " + appWin + " drawState=" + appWin.mWinAnimator.mDrawState); continue; } // Screenshot is ready to be taken. Everything from here below will continue // through the bottom of the loop and return a value. We only stay in the loop // because we don't want to release the mWindowMap lock until the screenshot is Loading Loading @@ -6224,9 +6205,6 @@ public class WindowManagerService extends IWindowManager.Stub } } break; } if (DEBUG_SCREENSHOT) { // TEST IF IT's ALL BLACK int[] buffer = new int[bm.getWidth() * bm.getHeight()]; Loading