Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 672fc6c6 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge remote-tracking branch 'origin/lineage-16.0' into v1-pie

parents af2fc58f 80fb3fb4
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -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);
@@ -1288,7 +1289,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 */);
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ JHwBlob::JHwBlob(JNIEnv *env, jobject thiz, size_t size)
      mOwnsBuffer(true),
      mHandle(0) {
    if (size > 0) {
        mBuffer = malloc(size);
        mBuffer = calloc(size, 1);
    }
}

+7 −5
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static Rect rectFromObj(JNIEnv* env, jobject rectObj) {
static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz,
        jobject displayTokenObj, jobject sourceCropObj, jint width, jint height,
        jint minLayer, jint maxLayer, bool allLayers, bool useIdentityTransform,
        int rotation) {
        int rotation, bool captureSecureLayers) {
    sp<IBinder> displayToken = ibinderForJavaObject(env, displayTokenObj);
    if (displayToken == NULL) {
        return NULL;
@@ -171,9 +171,10 @@ 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, &buffer);
            rotation, captureSecureLayers, &buffer, capturedSecureLayers);
    if (res != NO_ERROR) {
        return NULL;
    }
@@ -184,7 +185,8 @@ static jobject nativeScreenshotToBuffer(JNIEnv* env, jclass clazz,
            buffer->getHeight(),
            buffer->getPixelFormat(),
            (jint)buffer->getUsage(),
            (jlong)buffer.get());
            (jlong)buffer.get(),
            capturedSecureLayers);
}

static jobject nativeScreenshotBitmap(JNIEnv* env, jclass clazz,
@@ -1026,7 +1028,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
    {"nativeGetHandle", "(J)Landroid/os/IBinder;",
            (void*)nativeGetHandle },
    {"nativeScreenshotToBuffer",
     "(Landroid/os/IBinder;Landroid/graphics/Rect;IIIIZZI)Landroid/graphics/GraphicBuffer;",
     "(Landroid/os/IBinder;Landroid/graphics/Rect;IIIIZZIZ)Landroid/graphics/GraphicBuffer;",
     (void*)nativeScreenshotToBuffer },
    {"nativeCaptureLayers", "(Landroid/os/IBinder;Landroid/graphics/Rect;F)Landroid/graphics/GraphicBuffer;",
            (void*)nativeCaptureLayers },
@@ -1082,7 +1084,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", "(IIIIJ)Landroid/graphics/GraphicBuffer;");
            "createFromExisting", "(IIIIJZ)Landroid/graphics/GraphicBuffer;");

    return err;
}
+2 −0
Original line number Diff line number Diff line
@@ -1379,8 +1379,10 @@
    <string name="ext_media_new_notification_message">Calca pa configurar</string>
    <string name="ext_media_ready_notification_message">Pa tresferir semeyes y multimedia</string>
    <string name="ext_media_unmountable_notification_message">Calca pa fixar</string>
    <string name="ext_media_unmountable_notification_message" product="tv"><xliff:g id="name" example="SD card">%s</xliff:g> ta toyida. Escueyi pa iguar.</string>
    <string name="ext_media_unsupported_notification_title">Nun se sofita <xliff:g id="name" example="SD card">%s</xliff:g></string>
    <string name="ext_media_unsupported_notification_message">Esti preséu nun ye compatible con <xliff:g id="name" example="SD card">%s</xliff:g>. Calca pa la so configuración nun formatu sofitáu.</string>
    <string name="ext_media_unsupported_notification_message" product="tv">Esti preséu nun sofita <xliff:g id="name" example="SD card">%s</xliff:g>. Escueyi pa configuralu nun formatu sofitáu.</string>
    <string name="ext_media_badremoval_notification_title"><xliff:g id="name" example="SD card">%s</xliff:g> estráxose de mou inesperáu</string>
    <string name="ext_media_init_action">Configurar</string>
    <string name="ext_media_unmount_action">Espulsar</string>
+3 −0
Original line number Diff line number Diff line
@@ -1387,6 +1387,7 @@ Pan mae Archwilio trwy Gyffwrdd ymlaen, rwyt yn clywed neu weld disgrifiadau\'r
    <string name="usb_unsupported_audio_accessory_message">Nid yw\'r ddyfais sydd wedi\'i chysylltu yn gydnaws â\'r ffôn hwn. Tapia i ddysgu mwy.</string>
    <string name="adb_active_notification_title">Dadfygio USB wedi cysylltu</string>
    <string name="adb_active_notification_message">Tapia i analluogi dadfygio USB</string>
    <string name="adb_active_notification_message" product="tv">Dewisa i analluogi dadfygio USB.</string>
    <string name="taking_remote_bugreport_notification_title">Yn cymryd adroddiad gwall\u2026</string>
    <string name="share_remote_bugreport_notification_title">Rhannu\'r adroddiad gwall?</string>
    <string name="sharing_remote_bugreport_notification_title">Yn rhannu\'r adroddiad gwall\u2026</string>
@@ -1412,8 +1413,10 @@ Pan mae Archwilio trwy Gyffwrdd ymlaen, rwyt yn clywed neu weld disgrifiadau\'r
    <string name="ext_media_ready_notification_message">I drosglwyddo lluniau a chyfryngau</string>
    <string name="ext_media_unmountable_notification_title">Problem gyda <xliff:g id="name" example="SD card">%s</xliff:g></string>
    <string name="ext_media_unmountable_notification_message">Tapia i drwsio</string>
    <string name="ext_media_unmountable_notification_message" product="tv">Mae <xliff:g id="name" example="SD card">%s</xliff:g> yn llwgr. Dewisa i drwsio.</string>
    <string name="ext_media_unsupported_notification_title"><xliff:g id="name" example="SD card">%s</xliff:g> anghydnaws</string>
    <string name="ext_media_unsupported_notification_message">Nid yw\'r ddyfais hon yn cefnogi\'r <xliff:g id="name" example="SD card">%s</xliff:g> yma. Tapia i\'w osod mewn fformat sy\'n gydnaws.</string>
    <string name="ext_media_unsupported_notification_message" product="tv">Nid yw\'r ddyfais hon yn cefnogi\'r <xliff:g id="name" example="SD card">%s</xliff:g> yma. Dewisa i\'w osod mewn fformat sy\'n gydnaws.</string>
    <string name="ext_media_badremoval_notification_title">Tynnwyd <xliff:g id="name" example="SD card">%s</xliff:g> yn annisgwyl</string>
    <string name="ext_media_badremoval_notification_message">Dadfowntia gyfrwng cyn ei dynnu allan er mwyn osgoi golli data</string>
    <string name="ext_media_nomedia_notification_title">Cafodd <xliff:g id="name" example="SD card">%s</xliff:g> ei dynnu</string>
Loading