Commit 90c1d6e9 authored by Andrew Grieve's avatar Andrew Grieve Committed by Chromium LUCI CQ

Android: Disable detectUntaggedSockets StrictMode check.

We don't tag our sockets, and this caused logspam on start-up.

Bug: 770792
Change-Id: I23cc6494a7a3e61bcb8be761c877bf4a0345f921
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2600033Reviewed-by: default avatarPeter Kotwicz <pkotwicz@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#838953}
parent 7daf9122
......@@ -105,16 +105,30 @@ public class ChromeStrictMode {
private static void turnOnDetection(StrictMode.ThreadPolicy.Builder threadPolicy,
StrictMode.VmPolicy.Builder vmPolicy) {
threadPolicy.detectAll();
// Do not enable detectUntaggedSockets(). It does not support native (the vast majority
// of our sockets), and we have not bothered to tag our Java uses.
// https://crbug.com/770792
vmPolicy.detectActivityLeaks()
.detectLeakedClosableObjects()
.detectLeakedRegistrationObjects()
.detectLeakedSqlLiteObjects();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
// Introduced in M.
vmPolicy.detectCleartextNetwork();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// Introduced in O.
vmPolicy.detectContentUriWithoutPermission();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// Introduced in Q.
vmPolicy.detectCredentialProtectedWhileLocked().detectImplicitDirectBoot();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
vmPolicy.detectAll();
} else {
// Explicitly enable detection of all violations except file URI leaks, as that
// results in false positives when file URI intents are passed between Chrome
// activities in separate processes. See http://crbug.com/508282#c11.
vmPolicy.detectActivityLeaks()
.detectLeakedClosableObjects()
.detectLeakedRegistrationObjects()
.detectLeakedSqlLiteObjects();
// File URI leak detection, has false positives when file URI intents are passed between
// Chrome activities in separate processes. See http://crbug.com/508282#c11.
vmPolicy.detectFileUriExposure();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment