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

Commit d5875d98 authored by Jeff Brown's avatar Jeff Brown
Browse files

Always log StrictMode violations on ENG builds.

The drop-box is too quiet and it masking real problems from
developers.  On ENG builds, use both logging and the drop-box
to ensure that problems are noticed promptly.

Change-Id: Id8fb8d392a7e01b532b73cb1a026b0d1f17af742
parent baaf8c3f
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;