Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge "Don't enable jdwp by default on userdebug builds" am: 3ade15d
Browse files Browse the repository at this point in the history
…am: 391e8ca am: 251978e am: 97e39b8 am: 209f25a

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2215481

Change-Id: I3b8d09585411c4da3aabdd501e9301ed293b03ff
Signed-off-by: Automerger Merge Worker <[email protected]>
  • Loading branch information
Mythri Alle authored and android-build-merge-worker-robot committed Sep 13, 2022
2 parents ae6d2bb + 209f25a commit 4653017
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions core/java/com/android/internal/os/Zygote.java
Original file line number Diff line number Diff line change
Expand Up @@ -1000,17 +1000,25 @@ static void applyUidSecurityPolicy(ZygoteArguments args, Credentials peer)
}
}

/**
* 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;
}
}
Expand Down

0 comments on commit 4653017

Please sign in to comment.