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

Commit 48731318 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Always log StrictMode violations on ENG builds."

parents 222b92a7 d5875d98
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -908,6 +908,9 @@ public final class StrictMode {

        if (!IS_USER_BUILD) {
            threadPolicyMask |= StrictMode.PENALTY_DROPBOX;
            if (IS_ENG_BUILD) {
                threadPolicyMask |= StrictMode.PENALTY_LOG;
            }
        }
        if (doFlashes) {
            threadPolicyMask |= StrictMode.PENALTY_FLASH;
@@ -918,7 +921,11 @@ public final class StrictMode {
        if (IS_USER_BUILD) {
            setCloseGuardEnabled(false);
        } else {
            setVmPolicy(new VmPolicy.Builder().detectAll().penaltyDropBox().build());
            VmPolicy.Builder policyBuilder = new VmPolicy.Builder().detectAll().penaltyDropBox();
            if (IS_ENG_BUILD) {
                policyBuilder.penaltyLog();
            }
            setVmPolicy(policyBuilder.build());
            setCloseGuardEnabled(vmClosableObjectLeaksEnabled());
        }
        return true;