Skip to content

Commit e69eaf5

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Don't log BlockGuard violations on ENG builds."
2 parents b545851 + be7c29c commit e69eaf5

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)