Chromium Code Reviews| Index: base/android/java/src/org/chromium/base/JNIUtils.java |
| diff --git a/base/android/java/src/org/chromium/base/JNIUtils.java b/base/android/java/src/org/chromium/base/JNIUtils.java |
| index f971b5e03cebd984bcd14066947c40a475f2afe4..cd7cc59885e6dc73ecd51b2beb8b64e907e02de8 100644 |
| --- a/base/android/java/src/org/chromium/base/JNIUtils.java |
| +++ b/base/android/java/src/org/chromium/base/JNIUtils.java |
| @@ -12,6 +12,8 @@ import org.chromium.base.annotations.MainDex; |
| */ |
| @MainDex |
| public class JNIUtils { |
| + private static boolean sSelectiveJniRegistrationEnabled; |
| + |
| /** |
| * This returns a ClassLoader that is capable of loading Chromium Java code. Such a ClassLoader |
| * is needed for the few cases where the JNI mechanism is unable to automatically determine the |
| @@ -21,4 +23,20 @@ public class JNIUtils { |
| public static Object getClassLoader() { |
| return JNIUtils.class.getClassLoader(); |
| } |
| + |
| + /** |
| + * @return whether or not the current process supports selective JNI registration. |
| + */ |
| + @CalledByNative |
| + public static boolean isSelectiveJniRegistrationEnabled() { |
| + return sSelectiveJniRegistrationEnabled; |
| + } |
| + |
| + /** |
| + * Allow this process to selectively perform JNI registration. This must be called before |
| + * loading native libraries or it will have no effect. |
| + */ |
| + public static void enableSelectiveJniRegistration() { |
| + sSelectiveJniRegistrationEnabled = true; |
|
Ted C
2017/01/31 17:56:53
should we make sSelectiveJniRegistrationEnabled a
estevenson
2017/01/31 18:56:41
Good call. Done.
|
| + } |
| } |