If CheckJNI is enabled don't allow app workarounds

(cherry picked from commit 46963dff1d1592729ba1e8b274835bf6c80a50bd)

Change-Id: I2d054bf0824ec8378291d2035fc0586c6ec9aa2e
diff --git a/vm/native/dalvik_system_VMRuntime.cpp b/vm/native/dalvik_system_VMRuntime.cpp
index 714878c..124c64f 100644
--- a/vm/native/dalvik_system_VMRuntime.cpp
+++ b/vm/native/dalvik_system_VMRuntime.cpp
@@ -199,9 +199,13 @@
     // Note that this value may be 0, meaning "current".
     int targetSdkVersion = args[1];
     if (targetSdkVersion > 0 && targetSdkVersion <= 13 /* honeycomb-mr2 */) {
-        // TODO: running with CheckJNI should override this and force you to obey the strictest rules.
-        ALOGI("Turning on JNI app bug workarounds for target SDK version %i...", targetSdkVersion);
-        gDvmJni.workAroundAppJniBugs = true;
+        if (gDvmJni.useCheckJni) {
+            ALOGI("CheckJNI enabled: not enabling JNI app bug workarounds.");
+        } else {
+            ALOGI("Enabling JNI app bug workarounds for target SDK version %i...",
+                  targetSdkVersion);
+            gDvmJni.workAroundAppJniBugs = true;
+        }
     }
     RETURN_VOID();
 }