Add the "debug.jni.logging" property so third-party developers can debug their JNI problems.
This turns on the super-verbose but indispensible logging of all native method
calls and all calls to JNI functions (for third-party code only). In particular,
if you have a local reference bug, you can search for the reference given in
the crash and see exactly where it came from. In every case I've seen so far,
that's pinpointed the bug exactly.
Change-Id: Ifb7ba02ae637bdd53cd8500febdcb9d4d7799bda
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 48b0b66..29cccb6 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1953,6 +1953,9 @@
if ("1".equals(SystemProperties.get("debug.checkjni"))) {
debugFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;
}
+ if ("1".equals(SystemProperties.get("debug.jni.logging"))) {
+ debugFlags |= Zygote.DEBUG_ENABLE_JNI_LOGGING;
+ }
if ("1".equals(SystemProperties.get("debug.assert"))) {
debugFlags |= Zygote.DEBUG_ENABLE_ASSERT;
}