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

Commit 1cd93b8f authored by Mathieu Chartier's avatar Mathieu Chartier Committed by android-build-merger
Browse files

Merge "Disable activity leak detection by default for userdebug" into oc-dev...

Merge "Disable activity leak detection by default for userdebug" into oc-dev am: 956ea5f0 am: 8d189593
am: 0681ebd5

Change-Id: Ic0510ef945839d99ec27857b59e25d4e1cd8a911
parents 45b95d5f 0681ebd5
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -936,6 +936,11 @@ public final class StrictMode {
                return this;
            }

            Builder disable(int bit) {
                mMask &= ~bit;
                return this;
            }

            /**
             * Construct the VmPolicy instance.
             *
@@ -1214,7 +1219,13 @@ public final class StrictMode {
        if (IS_USER_BUILD) {
            setCloseGuardEnabled(false);
        } else {
            VmPolicy.Builder policyBuilder = new VmPolicy.Builder().detectAll().penaltyDropBox();
            VmPolicy.Builder policyBuilder = new VmPolicy.Builder().detectAll();
            if (!IS_ENG_BUILD) {
                // Activity leak detection causes too much slowdown for userdebug because of the
                // GCs.
                policyBuilder = policyBuilder.disable(DETECT_VM_ACTIVITY_LEAKS);
            }
            policyBuilder = policyBuilder.penaltyDropBox();
            if (IS_ENG_BUILD) {
                policyBuilder.penaltyLog();
            }