summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2022-09-13 13:08:26 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-09-13 13:08:26 +0000
commit251978e0da1387303960ea50f10f0d77cf8d893d (patch)
tree5eeff9fe3834e800b327ff62cf1dd35a0fb3651f
parentaf8d5bdfd83b138a5aca51ff333f8eb2de5f5662 (diff)
parent391e8ca76a36d01b18540e5f7eb267aa1b6c3d31 (diff)
Merge "Don't enable jdwp by default on userdebug builds" am: 3ade15d233 am: 391e8ca76a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2215481 Change-Id: Ic1481a6d93e546eb0db1d7c8827e2529a055fdce Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/java/com/android/internal/os/Zygote.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index b1e7d15cbf4a..ea5f0b2f2144 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -1001,16 +1001,24 @@ public final class Zygote {
}
/**
+ * This will enable jdwp by default for all apps. It is OK to cache this property
+ * because we expect to reboot the system whenever this property changes
+ */
+ private static final boolean ENABLE_JDWP = SystemProperties.get(
+ "persist.debuggable.dalvik.vm.jdwp.enabled").equals("1");
+
+ /**
* Applies debugger system properties to the zygote arguments.
*
- * If "ro.debuggable" is "1", all apps are debuggable. Otherwise,
- * the debugger state is specified via the "--enable-jdwp" flag
- * in the spawn request.
+ * For eng builds all apps are debuggable. On userdebug and user builds
+ * if persist.debuggable.dalvik.vm.jdwp.enabled is 1 all apps are
+ * debuggable. Otherwise, the debugger state is specified via the
+ * "--enable-jdwp" flag in the spawn request.
*
* @param args non-null; zygote spawner args
*/
static void applyDebuggerSystemProperty(ZygoteArguments args) {
- if (RoSystemProperties.DEBUGGABLE) {
+ if (Build.IS_ENG || ENABLE_JDWP) {
args.mRuntimeFlags |= Zygote.DEBUG_ENABLE_JDWP;
}
}