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

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

Don't log BlockGuard violations on ENG builds.

We want to see CloseGuard violations in the log in ENG builds
because they indicate serious problems, but BlockGuard is
too noisy and is best viewed in the aggregate from the
drop box based tools.

Change-Id: I77d4d0a561a4299355c111d0ccb5a2147646245b
parent 384bf04a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import dalvik.system.VMDebug;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
@@ -902,15 +901,13 @@ public final class StrictMode {
            return false;
        }

        // Thread policy controls BlockGuard.
        int threadPolicyMask = StrictMode.DETECT_DISK_WRITE |
                StrictMode.DETECT_DISK_READ |
                StrictMode.DETECT_NETWORK;

        if (!IS_USER_BUILD) {
            threadPolicyMask |= StrictMode.PENALTY_DROPBOX;
            if (IS_ENG_BUILD) {
                threadPolicyMask |= StrictMode.PENALTY_LOG;
            }
        }
        if (doFlashes) {
            threadPolicyMask |= StrictMode.PENALTY_FLASH;
@@ -918,6 +915,8 @@ public final class StrictMode {

        StrictMode.setThreadPolicyMask(threadPolicyMask);

        // VM Policy controls CloseGuard, detection of Activity leaks,
        // and instance counting.
        if (IS_USER_BUILD) {
            setCloseGuardEnabled(false);
        } else {