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

Commit cba56aca authored by Evan Rosky's avatar Evan Rosky Committed by android-build-merger
Browse files

Merge "Fix metadata surfacecontrol api/jni" into qt-dev

am: 96aaa9f2

Change-Id: I5640c0ff8142bd999f2e8d129440c16cb5bfba73
parents 4fb74208 96aaa9f2
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -195,7 +195,8 @@ public final class SurfaceControl implements Parcelable {
    private static native void nativeTransferTouchFocus(long transactionObj, IBinder fromToken,
            IBinder toToken);
    private static native boolean nativeGetProtectedContentSupport();
    private static native void nativeSetMetadata(long transactionObj, int key, Parcel data);
    private static native void nativeSetMetadata(long transactionObj, long nativeObject, int key,
            Parcel data);
    private static native void nativeSyncInputWindows(long transactionObj);
    private static native boolean nativeGetDisplayBrightnessSupport(IBinder displayToken);
    private static native boolean nativeSetDisplayBrightness(IBinder displayToken,
@@ -2612,11 +2613,11 @@ public final class SurfaceControl implements Parcelable {
         * Sets an arbitrary piece of metadata on the surface. This is a helper for int data.
         * @hide
         */
        public Transaction setMetadata(int key, int data) {
        public Transaction setMetadata(SurfaceControl sc, int key, int data) {
            Parcel parcel = Parcel.obtain();
            parcel.writeInt(data);
            try {
                setMetadata(key, parcel);
                setMetadata(sc, key, parcel);
            } finally {
                parcel.recycle();
            }
@@ -2627,8 +2628,8 @@ public final class SurfaceControl implements Parcelable {
         * Sets an arbitrary piece of metadata on the surface.
         * @hide
         */
        public Transaction setMetadata(int key, Parcel data) {
            nativeSetMetadata(mNativeObject, key, data);
        public Transaction setMetadata(SurfaceControl sc, int key, Parcel data) {
            nativeSetMetadata(mNativeObject, sc.mNativeObject, key, data);
            return this;
        }

+1 −1
Original line number Diff line number Diff line
@@ -1361,7 +1361,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
            (void*)nativeSetInputWindowInfo },
    {"nativeTransferTouchFocus", "(JLandroid/os/IBinder;Landroid/os/IBinder;)V",
            (void*)nativeTransferTouchFocus },
    {"nativeSetMetadata", "(JILandroid/os/Parcel;)V",
    {"nativeSetMetadata", "(JJILandroid/os/Parcel;)V",
            (void*)nativeSetMetadata },
    {"nativeGetDisplayedContentSamplingAttributes",
            "(Landroid/os/IBinder;)Landroid/hardware/display/DisplayedContentSamplingAttributes;",
+2 −2
Original line number Diff line number Diff line
@@ -230,12 +230,12 @@ public class StubTransaction extends SurfaceControl.Transaction {
    }

    @Override
    public SurfaceControl.Transaction setMetadata(int key, int data) {
    public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, int data) {
        return this;
    }

    @Override
    public SurfaceControl.Transaction setMetadata(int key, Parcel data) {
    public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, Parcel data) {
        return this;
    }