diff options
author | Ian Rogers <irogers@google.com> | 2013-08-13 20:07:05 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-08-13 20:07:05 -0700 |
commit | 1a4d6d809b4c24580b4667e3075d545738d83ec7 (patch) | |
tree | 2b1ba966630ab935e85aa8519d3ed33b907ce107 | |
parent | e2f77e7592842cad5a59e73535b8982c35e156ca (diff) | |
download | art-1a4d6d809b4c24580b4667e3075d545738d83ec7.tar.gz art-1a4d6d809b4c24580b4667e3075d545738d83ec7.tar.bz2 art-1a4d6d809b4c24580b4667e3075d545738d83ec7.zip |
If CheckJNI is enabled don't allow app workarounds
Change-Id: I030231d2b1ebcabb5c3922ea91230b40998711ba
-rw-r--r-- | runtime/native/dalvik_system_VMRuntime.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index 5fb53df6d..b0f67c4c2 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -131,10 +131,6 @@ static jstring VMRuntime_vmLibrary(JNIEnv* env, jobject) { return env->NewStringUTF(kIsDebugBuild ? "libartd.so" : "libart.so"); } -static void DisableCheckJniCallback(Thread* t, void*) { - t->GetJniEnv()->SetCheckJniEnabled(false); -} - static void VMRuntime_setTargetSdkVersion(JNIEnv* env, jobject, jint targetSdkVersion) { // This is the target SDK version of the app we're about to run. // Note that targetSdkVersion may be CUR_DEVELOPMENT (10000). @@ -143,17 +139,13 @@ static void VMRuntime_setTargetSdkVersion(JNIEnv* env, jobject, jint targetSdkVe Runtime* runtime = Runtime::Current(); JavaVMExt* vm = runtime->GetJavaVM(); if (vm->check_jni) { - LOG(WARNING) << "Turning off CheckJNI so we can turn on JNI app bug workarounds..."; - Thread* self = static_cast<JNIEnvExt*>(env)->self; - MutexLock mu(self, *Locks::thread_list_lock_); - vm->SetCheckJniEnabled(false); - runtime->GetThreadList()->ForEach(DisableCheckJniCallback, NULL); - } + LOG(INFO) << "CheckJNI enabled: not enabling JNI app bug workarounds."; + } else { + LOG(INFO) << "Turning on JNI app bug workarounds for target SDK version " + << targetSdkVersion << "..."; - LOG(INFO) << "Turning on JNI app bug workarounds for target SDK version " - << targetSdkVersion << "..."; - - vm->work_around_app_jni_bugs = true; + vm->work_around_app_jni_bugs = true; + } } } |