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

Commit 643e1c2d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SurfaceControl] Add API to query protected content support."

parents e9648ac6 0ddb7d49
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class SurfaceControl implements Parcelable {
            InputWindowHandle handle);
    private static native void nativeTransferTouchFocus(long transactionObj, IBinder fromToken,
            IBinder toToken);
    private static native boolean nativeGetProtectedContentSupport();

    private final CloseGuard mCloseGuard = CloseGuard.get();
    private String mName;
@@ -1729,6 +1730,14 @@ public class SurfaceControl implements Parcelable {
        return nativeCaptureLayers(layerHandleToken, sourceCrop, frameScale);
    }

    /**
     * Returns whether protected content is supported in GPU composition.
     * @hide
     */
    public static boolean getProtectedContentSupport() {
        return nativeGetProtectedContentSupport();
    }

    /**
     * @hide
     */
+6 −0
Original line number Diff line number Diff line
@@ -660,6 +660,10 @@ static void nativeSetDisplayPowerMode(JNIEnv* env, jclass clazz, jobject tokenOb
    if (t.duration() > 100ms) ALOGD("Excessive delay in setPowerMode()");
}

static jboolean nativeGetProtectedContentSupport(JNIEnv* env, jclass) {
    return static_cast<jboolean>(SurfaceComposerClient::getProtectedContentSupport());
}

static jboolean nativeClearContentFrameStats(JNIEnv* env, jclass clazz, jlong nativeObject) {
    SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject);
    status_t err = ctrl->clearLayerFrameStats();
@@ -1028,6 +1032,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeGetAnimationFrameStats },
    {"nativeSetDisplayPowerMode", "(Landroid/os/IBinder;I)V",
            (void*)nativeSetDisplayPowerMode },
    {"nativeGetProtectedContentSupport", "()Z",
            (void*)nativeGetProtectedContentSupport },
    {"nativeDeferTransactionUntil", "(JJLandroid/os/IBinder;J)V",
            (void*)nativeDeferTransactionUntil },
    {"nativeDeferTransactionUntilSurface", "(JJJJ)V",