@@ -125,9 +125,6 @@ public final class StrictMode {
125125 private static final String TAG = "StrictMode" ;
126126 private static final boolean LOG_V = Log .isLoggable (TAG , Log .VERBOSE );
127127
128- private static final boolean IS_USER_BUILD = "user" .equals (Build .TYPE );
129- private static final boolean IS_ENG_BUILD = "eng" .equals (Build .TYPE );
130-
131128 /**
132129 * Boolean system property to disable strict mode checks outright.
133130 * Set this to 'true' to force disable; 'false' has no effect on other
@@ -1191,15 +1188,15 @@ public static boolean conditionallyEnableDebugLogging() {
11911188
11921189 // For debug builds, log event loop stalls to dropbox for analysis.
11931190 // Similar logic also appears in ActivityThread.java for system apps.
1194- if (!doFlashes && (IS_USER_BUILD || suppress )) {
1191+ if (!doFlashes && (Build . IS_USER || suppress )) {
11951192 setCloseGuardEnabled (false );
11961193 return false ;
11971194 }
11981195
11991196 // Eng builds have flashes on all the time. The suppression property
12001197 // overrides this, so we force the behavior only after the short-circuit
12011198 // check above.
1202- if (IS_ENG_BUILD ) {
1199+ if (Build . IS_ENG ) {
12031200 doFlashes = true ;
12041201 }
12051202
@@ -1208,7 +1205,7 @@ public static boolean conditionallyEnableDebugLogging() {
12081205 StrictMode .DETECT_DISK_READ |
12091206 StrictMode .DETECT_NETWORK ;
12101207
1211- if (!IS_USER_BUILD ) {
1208+ if (!Build . IS_USER ) {
12121209 threadPolicyMask |= StrictMode .PENALTY_DROPBOX ;
12131210 }
12141211 if (doFlashes ) {
@@ -1219,23 +1216,25 @@ public static boolean conditionallyEnableDebugLogging() {
12191216
12201217 // VM Policy controls CloseGuard, detection of Activity leaks,
12211218 // and instance counting.
1222- if (IS_USER_BUILD ) {
1219+ if (Build . IS_USER ) {
12231220 setCloseGuardEnabled (false );
12241221 } else {
12251222 VmPolicy .Builder policyBuilder = new VmPolicy .Builder ().detectAll ();
1226- if (!IS_ENG_BUILD ) {
1223+ if (!Build . IS_ENG ) {
12271224 // Activity leak detection causes too much slowdown for userdebug because of the
12281225 // GCs.
12291226 policyBuilder = policyBuilder .disable (DETECT_VM_ACTIVITY_LEAKS );
12301227 }
12311228 policyBuilder = policyBuilder .penaltyDropBox ();
1232- if (IS_ENG_BUILD ) {
1229+ if (Build . IS_ENG ) {
12331230 policyBuilder .penaltyLog ();
12341231 }
12351232 // All core system components need to tag their sockets to aid
12361233 // system health investigations
12371234 if (android .os .Process .myUid () < android .os .Process .FIRST_APPLICATION_UID ) {
1238- policyBuilder .detectUntaggedSockets ();
1235+ policyBuilder .enable (DETECT_VM_UNTAGGED_SOCKET );
1236+ } else {
1237+ policyBuilder .disable (DETECT_VM_UNTAGGED_SOCKET );
12391238 }
12401239 setVmPolicy (policyBuilder .build ());
12411240 setCloseGuardEnabled (vmClosableObjectLeaksEnabled ());
@@ -2294,7 +2293,7 @@ protected IWindowManager create() {
22942293 * @hide
22952294 */
22962295 public static Span enterCriticalSpan (String name ) {
2297- if (IS_USER_BUILD ) {
2296+ if (Build . IS_USER ) {
22982297 return NO_OP_SPAN ;
22992298 }
23002299 if (name == null || name .isEmpty ()) {
0 commit comments