Skip to content

Commit be7c29c

Browse files
author
Jeff Brown
committed
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
1 parent 384bf04 commit be7c29c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/java/android/os/StrictMode.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import java.io.PrintWriter;
3636
import java.io.StringWriter;
3737
import java.util.ArrayList;
38-
import java.util.Collections;
3938
import java.util.HashMap;
4039
import java.util.Map;
4140
import java.util.concurrent.atomic.AtomicInteger;
@@ -902,22 +901,22 @@ public static boolean conditionallyEnableDebugLogging() {
902901
return false;
903902
}
904903

904+
// Thread policy controls BlockGuard.
905905
int threadPolicyMask = StrictMode.DETECT_DISK_WRITE |
906906
StrictMode.DETECT_DISK_READ |
907907
StrictMode.DETECT_NETWORK;
908908

909909
if (!IS_USER_BUILD) {
910910
threadPolicyMask |= StrictMode.PENALTY_DROPBOX;
911-
if (IS_ENG_BUILD) {
912-
threadPolicyMask |= StrictMode.PENALTY_LOG;
913-
}
914911
}
915912
if (doFlashes) {
916913
threadPolicyMask |= StrictMode.PENALTY_FLASH;
917914
}
918915

919916
StrictMode.setThreadPolicyMask(threadPolicyMask);
920917

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

0 commit comments

Comments
 (0)