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

This commit is contained in:
TreeHugger Robot
2019-04-05 18:33:24 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 8 deletions

View File

@@ -195,7 +195,8 @@ public final class SurfaceControl implements Parcelable {
private static native void nativeTransferTouchFocus(long transactionObj, IBinder fromToken, private static native void nativeTransferTouchFocus(long transactionObj, IBinder fromToken,
IBinder toToken); IBinder toToken);
private static native boolean nativeGetProtectedContentSupport(); 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 void nativeSyncInputWindows(long transactionObj);
private static native boolean nativeGetDisplayBrightnessSupport(IBinder displayToken); private static native boolean nativeGetDisplayBrightnessSupport(IBinder displayToken);
private static native boolean nativeSetDisplayBrightness(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. * Sets an arbitrary piece of metadata on the surface. This is a helper for int data.
* @hide * @hide
*/ */
public Transaction setMetadata(int key, int data) { public Transaction setMetadata(SurfaceControl sc, int key, int data) {
Parcel parcel = Parcel.obtain(); Parcel parcel = Parcel.obtain();
parcel.writeInt(data); parcel.writeInt(data);
try { try {
setMetadata(key, parcel); setMetadata(sc, key, parcel);
} finally { } finally {
parcel.recycle(); parcel.recycle();
} }
@@ -2627,8 +2628,8 @@ public final class SurfaceControl implements Parcelable {
* Sets an arbitrary piece of metadata on the surface. * Sets an arbitrary piece of metadata on the surface.
* @hide * @hide
*/ */
public Transaction setMetadata(int key, Parcel data) { public Transaction setMetadata(SurfaceControl sc, int key, Parcel data) {
nativeSetMetadata(mNativeObject, key, data); nativeSetMetadata(mNativeObject, sc.mNativeObject, key, data);
return this; return this;
} }

View File

@@ -1361,7 +1361,7 @@ static const JNINativeMethod sSurfaceControlMethods[] = {
(void*)nativeSetInputWindowInfo }, (void*)nativeSetInputWindowInfo },
{"nativeTransferTouchFocus", "(JLandroid/os/IBinder;Landroid/os/IBinder;)V", {"nativeTransferTouchFocus", "(JLandroid/os/IBinder;Landroid/os/IBinder;)V",
(void*)nativeTransferTouchFocus }, (void*)nativeTransferTouchFocus },
{"nativeSetMetadata", "(JILandroid/os/Parcel;)V", {"nativeSetMetadata", "(JJILandroid/os/Parcel;)V",
(void*)nativeSetMetadata }, (void*)nativeSetMetadata },
{"nativeGetDisplayedContentSamplingAttributes", {"nativeGetDisplayedContentSamplingAttributes",
"(Landroid/os/IBinder;)Landroid/hardware/display/DisplayedContentSamplingAttributes;", "(Landroid/os/IBinder;)Landroid/hardware/display/DisplayedContentSamplingAttributes;",

View File

@@ -230,12 +230,12 @@ public class StubTransaction extends SurfaceControl.Transaction {
} }
@Override @Override
public SurfaceControl.Transaction setMetadata(int key, int data) { public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, int data) {
return this; return this;
} }
@Override @Override
public SurfaceControl.Transaction setMetadata(int key, Parcel data) { public SurfaceControl.Transaction setMetadata(SurfaceControl sc, int key, Parcel data) {
return this; return this;
} }