Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e14b396e authored by Mythri Alle's avatar Mythri Alle Committed by Automerger Merge Worker
Browse files

Merge "Reland "Don't enable jdwp by default on userdebug builds""" am:...

Merge "Reland "Don't enable jdwp by default on userdebug builds""" am: f3683fca am: a1b0512a am: 59afb30f

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



Change-Id: I27a938f9b4d1f24fe82d59c0c0edb2f2c22f9d53
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d4635b31 59afb30f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@

    <application>
        <uses-library android:name="android.test.runner" />
        <profileable android:shell="true" />
        <activity android:name="android.perftests.utils.PerfTestActivity"
            android:exported="true">
          <intent-filter>
+12 −4
Original line number Diff line number Diff line
@@ -1000,17 +1000,25 @@ 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.debug.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;
        }
    }