diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-08 18:35:02 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-07-08 18:35:02 +0000 |
| commit | f84f3454c7f58cb4256f8d7d6000629c15c5faed (patch) | |
| tree | 35ee835f991e4ac78edec07a152790371926e4d9 /core/java/android | |
| parent | 799a8ca54fed42bcd4ce25dfc6f80db2c3ad8cdc (diff) | |
| parent | b3f4ac23836263a1f7844b12455a81150c92bace (diff) | |
Snap for 5600800 from b3f4ac23836263a1f7844b12455a81150c92bace to pi-platform-release
Change-Id: I3b3671176a1bcb52a6a1efa8b295ac03b0ce7241
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/SurfaceControl.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java index ed8b0053e5bf..eec34cdc12cc 100644 --- a/core/java/android/view/SurfaceControl.java +++ b/core/java/android/view/SurfaceControl.java @@ -74,7 +74,8 @@ public class SurfaceControl implements Parcelable { boolean allLayers, boolean useIdentityTransform, int rotation); private static native GraphicBuffer nativeScreenshotToBuffer(IBinder displayToken, Rect sourceCrop, int width, int height, int minLayer, int maxLayer, - boolean allLayers, boolean useIdentityTransform, int rotation); + boolean allLayers, boolean useIdentityTransform, int rotation, + boolean captureSecureLayers); private static native void nativeScreenshot(IBinder displayToken, Surface consumer, Rect sourceCrop, int width, int height, int minLayer, int maxLayer, boolean allLayers, boolean useIdentityTransform); @@ -1249,7 +1250,28 @@ public class SurfaceControl implements Parcelable { IBinder displayToken = SurfaceControl.getBuiltInDisplay( SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN); return nativeScreenshotToBuffer(displayToken, sourceCrop, width, height, - minLayer, maxLayer, false, useIdentityTransform, rotation); + minLayer, maxLayer, false, useIdentityTransform, rotation, + false /* captureSecureLayers */); + } + + /** + * Like screenshotToBuffer, but if the caller is AID_SYSTEM, allows + * for the capture of secure layers. This is used for the screen rotation + * animation where the system server takes screenshots but does + * not persist them or allow them to leave the server. However in other + * cases in the system server, we mostly want to omit secure layers + * like when we take a screenshot on behalf of the assistant. + * + * @hide + */ + public static GraphicBuffer screenshotToBufferWithSecureLayersUnsafe(Rect sourceCrop, + int width, int height, int minLayer, int maxLayer, boolean useIdentityTransform, + int rotation) { + IBinder displayToken = SurfaceControl.getBuiltInDisplay( + SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN); + return nativeScreenshotToBuffer(displayToken, sourceCrop, width, height, + minLayer, maxLayer, false, useIdentityTransform, rotation, + true /* captureSecureLayers */); } /** |
