Index: base/android/jni_android.cc |
diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc |
index e09c2d5d150587aedfbb9d57fc294b57dcc931ad..a2de00aca2a3fcf2ce0c8c82bd06afc48229c256 100644 |
--- a/base/android/jni_android.cc |
+++ b/base/android/jni_android.cc |
@@ -17,6 +17,8 @@ using base::android::GetClass; |
using base::android::MethodID; |
using base::android::ScopedJavaLocalRef; |
+bool g_disable_manual_jni_registration = false; |
+ |
JavaVM* g_jvm = NULL; |
// Leak the global app context, as it is used from a non-joinable worker thread |
// that may still be running at shutdown. There is no harm in doing this. |
@@ -77,6 +79,15 @@ std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) { |
namespace base { |
namespace android { |
+bool IsManualJniRegistrationDisabled() { |
+ return g_disable_manual_jni_registration; |
+} |
+ |
+void DisableManualJniRegistration() { |
+ DCHECK(!g_disable_manual_jni_registration); |
+ g_disable_manual_jni_registration = true; |
+} |
+ |
JNIEnv* AttachCurrentThread() { |
DCHECK(g_jvm); |
JNIEnv* env = NULL; |