From 4f83d813d6251900a726c37b1408aaf7c063a493 Mon Sep 17 00:00:00 2001 From: Rucha Katakwar Date: Fri, 9 Jul 2021 06:30:55 +0000 Subject: [PATCH] Revert "Camera: Restore FastNative annotation." Bug: 193176503 This reverts commit 99ebd95ef140a14185b729e419abe19c6dc0a678. Reason for revert: Recent flakiness as mentioned in b/193176503.This cl was merged in build:7532561. Any test failures post this build shows exception linked to CameraMetadataNative.Reverting this cl to find and fix the issue. Change-Id: If9fe3ce69f013b842a47745d976942aa71dfb8f6 --- .../camera2/impl/CameraMetadataNative.java | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index 09fe1020ea596..6cbe107c96f5b 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -1869,40 +1869,28 @@ public class CameraMetadataNative implements Parcelable { @FastNative private static native void nativeUpdate(long dst, long src); - @FastNative - private static native void nativeWriteToParcel(Parcel dest, long ptr); - @FastNative - private static native void nativeReadFromParcel(Parcel source, long ptr); - @FastNative - private static native void nativeSwap(long ptr, long otherPtr) + private static synchronized native void nativeWriteToParcel(Parcel dest, long ptr); + private static synchronized native void nativeReadFromParcel(Parcel source, long ptr); + private static synchronized native void nativeSwap(long ptr, long otherPtr) throws NullPointerException; @FastNative - private static native void nativeClose(long ptr); - @FastNative - private static native boolean nativeIsEmpty(long ptr); - @FastNative - private static native int nativeGetEntryCount(long ptr); - @FastNative - private static native long nativeGetBufferSize(long ptr); - @FastNative private static native void nativeSetVendorId(long ptr, long vendorId); + private static synchronized native void nativeClose(long ptr); + private static synchronized native boolean nativeIsEmpty(long ptr); + private static synchronized native int nativeGetEntryCount(long ptr); + private static synchronized native long nativeGetBufferSize(long ptr); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - @FastNative - private static native byte[] nativeReadValues(int tag, long ptr); - @FastNative - private static native void nativeWriteValues(int tag, byte[] src, long ptr); + private static synchronized native byte[] nativeReadValues(int tag, long ptr); + private static synchronized native void nativeWriteValues(int tag, byte[] src, long ptr); private static synchronized native void nativeDump(long ptr) throws IOException; // dump to LOGD - @FastNative - private static native ArrayList nativeGetAllVendorKeys(long ptr, Class keyClass); + private static synchronized native ArrayList nativeGetAllVendorKeys(long ptr, Class keyClass); @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - @FastNative - private static native int nativeGetTagFromKeyLocal(long ptr, String keyName) + private static synchronized native int nativeGetTagFromKeyLocal(long ptr, String keyName) throws IllegalArgumentException; @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - @FastNative - private static native int nativeGetTypeFromTagLocal(long ptr, int tag) + private static synchronized native int nativeGetTypeFromTagLocal(long ptr, int tag) throws IllegalArgumentException; @FastNative private static native int nativeGetTagFromKey(String keyName, long vendorId)