Loading core/jni/android_view_SurfaceControl.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -171,10 +171,9 @@ static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz, maxLayer = INT32_MAX; } sp<GraphicBuffer> buffer; bool capturedSecureLayers = false; status_t res = ScreenshotClient::capture(displayToken, sourceCrop, width, height, minLayer, maxLayer, useIdentityTransform, rotation, captureSecureLayers, &buffer, capturedSecureLayers); rotation, captureSecureLayers, &buffer); if (res != NO_ERROR) { return NULL; } Loading @@ -185,8 +184,7 @@ static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz, buffer->getHeight(), buffer->getPixelFormat(), (jint)buffer->getUsage(), (jlong)buffer.get(), capturedSecureLayers); (jlong)buffer.get()); } static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz, Loading Loading @@ -1084,7 +1082,7 @@ int register_android_view_SurfaceControl(JNIEnv* env) jclass graphicsBufferClazz = FindClassOrDie(env, "android/graphics/GraphicBuffer"); gGraphicBufferClassInfo.clazz = MakeGlobalRefOrDie(env, graphicsBufferClazz); gGraphicBufferClassInfo.builder = GetStaticMethodIDOrDie(env, graphicsBufferClazz, "createFromExisting", "(IIIIJZ)Landroid/graphics/GraphicBuffer;"); "createFromExisting", "(IIIIJ)Landroid/graphics/GraphicBuffer;"); return err; } Loading graphics/java/android/graphics/GraphicBuffer.java +4 −33 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ public class GraphicBuffer implements Parcelable { private final int mHeight; private final int mFormat; private final int mUsage; private final boolean mCapturedSecureLayers; // Note: do not rename, this field is used by native code private final long mNativeObject; Loading Loading @@ -83,23 +82,14 @@ public class GraphicBuffer implements Parcelable { } /** * Private use only. See {@link #create(int, int, int, int, boolean)}. * Private use only. See {@link #create(int, int, int, int)}. */ private GraphicBuffer(int width, int height, int format, int usage, long nativeObject, boolean capturedSecureLayers) { private GraphicBuffer(int width, int height, int format, int usage, long nativeObject) { mWidth = width; mHeight = height; mFormat = format; mUsage = usage; mNativeObject = nativeObject; mCapturedSecureLayers = capturedSecureLayers; } /** * Private use only. See {@link #create(int, int, int, int)}. */ private GraphicBuffer(int width, int height, int format, int usage, long nativeObject) { this(width, height, format, usage, nativeObject, false); } /** Loading @@ -107,33 +97,14 @@ public class GraphicBuffer implements Parcelable { * @hide */ public static GraphicBuffer createFromExisting(int width, int height, int format, int usage, long unwrappedNativeObject, boolean capturedSecureLayers) { int format, int usage, long unwrappedNativeObject) { long nativeObject = nWrapGraphicBuffer(unwrappedNativeObject); if (nativeObject != 0) { return new GraphicBuffer(width, height, format, usage, nativeObject, capturedSecureLayers); return new GraphicBuffer(width, height, format, usage, nativeObject); } return null; } /** * For SurfaceControl JNI. Provides and ignored value for capturedSecureLayers for backwards * compatibility * @hide */ public static GraphicBuffer createFromExisting(int width, int height, int format, int usage, long unwrappedNativeObject) { return createFromExisting(width, height, format, usage, unwrappedNativeObject, false); } /** * Returns true if the buffer contains visible secure layers. */ public boolean doesContainSecureLayers() { return mCapturedSecureLayers; } /** * Returns the width of this buffer in pixels. */ Loading services/core/java/com/android/server/wm/ScreenRotationAnimation.java +0 −6 Original line number Diff line number Diff line Loading @@ -288,12 +288,6 @@ class ScreenRotationAnimation { } catch (RuntimeException e) { Slog.w(TAG, "Failed to attach screenshot - " + e.getMessage()); } // If the screenshot contains secure layers, we have to make sure the // screenshot surface we display it in also has FLAG_SECURE so that // the user can not screenshot secure layers via the screenshot surface. if (gb.doesContainSecureLayers()) { t.setSecure(mSurfaceControl, true); } t.setLayer(mSurfaceControl, SCREEN_FREEZE_LAYER_SCREENSHOT); t.setAlpha(mSurfaceControl, 0); t.show(mSurfaceControl); Loading Loading
core/jni/android_view_SurfaceControl.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -171,10 +171,9 @@ static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz, maxLayer = INT32_MAX; } sp<GraphicBuffer> buffer; bool capturedSecureLayers = false; status_t res = ScreenshotClient::capture(displayToken, sourceCrop, width, height, minLayer, maxLayer, useIdentityTransform, rotation, captureSecureLayers, &buffer, capturedSecureLayers); rotation, captureSecureLayers, &buffer); if (res != NO_ERROR) { return NULL; } Loading @@ -185,8 +184,7 @@ static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz, buffer->getHeight(), buffer->getPixelFormat(), (jint)buffer->getUsage(), (jlong)buffer.get(), capturedSecureLayers); (jlong)buffer.get()); } static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz, Loading Loading @@ -1084,7 +1082,7 @@ int register_android_view_SurfaceControl(JNIEnv* env) jclass graphicsBufferClazz = FindClassOrDie(env, "android/graphics/GraphicBuffer"); gGraphicBufferClassInfo.clazz = MakeGlobalRefOrDie(env, graphicsBufferClazz); gGraphicBufferClassInfo.builder = GetStaticMethodIDOrDie(env, graphicsBufferClazz, "createFromExisting", "(IIIIJZ)Landroid/graphics/GraphicBuffer;"); "createFromExisting", "(IIIIJ)Landroid/graphics/GraphicBuffer;"); return err; } Loading
graphics/java/android/graphics/GraphicBuffer.java +4 −33 Original line number Diff line number Diff line Loading @@ -52,7 +52,6 @@ public class GraphicBuffer implements Parcelable { private final int mHeight; private final int mFormat; private final int mUsage; private final boolean mCapturedSecureLayers; // Note: do not rename, this field is used by native code private final long mNativeObject; Loading Loading @@ -83,23 +82,14 @@ public class GraphicBuffer implements Parcelable { } /** * Private use only. See {@link #create(int, int, int, int, boolean)}. * Private use only. See {@link #create(int, int, int, int)}. */ private GraphicBuffer(int width, int height, int format, int usage, long nativeObject, boolean capturedSecureLayers) { private GraphicBuffer(int width, int height, int format, int usage, long nativeObject) { mWidth = width; mHeight = height; mFormat = format; mUsage = usage; mNativeObject = nativeObject; mCapturedSecureLayers = capturedSecureLayers; } /** * Private use only. See {@link #create(int, int, int, int)}. */ private GraphicBuffer(int width, int height, int format, int usage, long nativeObject) { this(width, height, format, usage, nativeObject, false); } /** Loading @@ -107,33 +97,14 @@ public class GraphicBuffer implements Parcelable { * @hide */ public static GraphicBuffer createFromExisting(int width, int height, int format, int usage, long unwrappedNativeObject, boolean capturedSecureLayers) { int format, int usage, long unwrappedNativeObject) { long nativeObject = nWrapGraphicBuffer(unwrappedNativeObject); if (nativeObject != 0) { return new GraphicBuffer(width, height, format, usage, nativeObject, capturedSecureLayers); return new GraphicBuffer(width, height, format, usage, nativeObject); } return null; } /** * For SurfaceControl JNI. Provides and ignored value for capturedSecureLayers for backwards * compatibility * @hide */ public static GraphicBuffer createFromExisting(int width, int height, int format, int usage, long unwrappedNativeObject) { return createFromExisting(width, height, format, usage, unwrappedNativeObject, false); } /** * Returns true if the buffer contains visible secure layers. */ public boolean doesContainSecureLayers() { return mCapturedSecureLayers; } /** * Returns the width of this buffer in pixels. */ Loading
services/core/java/com/android/server/wm/ScreenRotationAnimation.java +0 −6 Original line number Diff line number Diff line Loading @@ -288,12 +288,6 @@ class ScreenRotationAnimation { } catch (RuntimeException e) { Slog.w(TAG, "Failed to attach screenshot - " + e.getMessage()); } // If the screenshot contains secure layers, we have to make sure the // screenshot surface we display it in also has FLAG_SECURE so that // the user can not screenshot secure layers via the screenshot surface. if (gb.doesContainSecureLayers()) { t.setSecure(mSurfaceControl, true); } t.setLayer(mSurfaceControl, SCREEN_FREEZE_LAYER_SCREENSHOT); t.setAlpha(mSurfaceControl, 0); t.show(mSurfaceControl); Loading