From e8d910de023b1bf0021b82351d6c914ccafbad87 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Wed, 10 Feb 2021 17:11:36 -0500 Subject: [PATCH] Long screenshots: limit batch capture to 3 pages Bug: 179378294 Test: manual Change-Id: I63d524aefb9260e1e211848a46d3ebcaeae4e575 --- .../com/android/systemui/screenshot/ScrollCaptureClient.java | 4 ++-- .../android/systemui/screenshot/ScrollCaptureController.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureClient.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureClient.java index bb07012f23550..c8b5505a1411c 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureClient.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureClient.java @@ -50,8 +50,8 @@ import javax.inject.Inject; public class ScrollCaptureClient { private static final int TILE_SIZE_PX_MAX = 4 * (1024 * 1024); private static final int TILES_PER_PAGE = 2; // increase once b/174571735 is addressed - private static final int MAX_PAGES = 5; - private static final int MAX_IMAGE_COUNT = MAX_PAGES * TILES_PER_PAGE; + private static final float MAX_PAGES = 3f; + private static final int MAX_IMAGE_COUNT = (int) Math.ceil(MAX_PAGES * TILES_PER_PAGE); @VisibleForTesting static final int MATCH_ANY_TASK = ActivityTaskManager.INVALID_TASK_ID; diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java b/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java index 6fb5b7de29bcf..44e88471db3ba 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScrollCaptureController.java @@ -67,7 +67,6 @@ public class ScrollCaptureController implements OnComputeInternalInsetsListener SAVE } - public static final int MAX_PAGES = 5; public static final int MAX_HEIGHT = 12000; private final Connection mConnection;