Merge "Correct screenshot JNI code."
diff --git a/core/jni/android_view_SurfaceControl.cpp b/core/jni/android_view_SurfaceControl.cpp
index a3fef27..43f02c1 100644
--- a/core/jni/android_view_SurfaceControl.cpp
+++ b/core/jni/android_view_SurfaceControl.cpp
@@ -147,8 +147,8 @@
}
Rect sourceCrop = rectFromObj(env, sourceCropObj);
if (allLayers) {
- minLayer = 0;
- maxLayer = -1;
+ minLayer = INT32_MIN;
+ maxLayer = INT32_MAX;
}
sp<GraphicBuffer> buffer;
status_t res = ScreenshotClient::captureToBuffer(displayToken,
@@ -181,8 +181,8 @@
std::unique_ptr<ScreenshotClient> screenshot(new ScreenshotClient());
status_t res;
if (allLayers) {
- minLayer = 0;
- maxLayer = -1;
+ minLayer = INT32_MIN;
+ maxLayer = INT32_MAX;
}
res = screenshot->update(displayToken, sourceCrop, width, height,
@@ -254,8 +254,8 @@
Rect sourceCrop(left, top, right, bottom);
if (allLayers) {
- minLayer = 0;
- maxLayer = -1;
+ minLayer = INT32_MIN;
+ maxLayer = INT32_MAX;
}
ScreenshotClient::capture(displayToken,
consumer->getIGraphicBufferProducer(), sourceCrop,