From ffc4e30278f9fb49df7fa4ed0f4abf920820f4e6 Mon Sep 17 00:00:00 2001 From: jylitalbit <94119393+jylitalbit@users.noreply.github.com> Date: Mon, 15 Nov 2021 18:43:59 +0200 Subject: [PATCH] Ignore StrictMode warning (#1567) Currently the SystemWebView fails a CTS test case, specifically testStrictMode from WebViewHostSideStartupTest, due to StrictMode warnings. So ignore the StrictMode warning as is done elsewhere. --- build/patches/JIT-less-toggle.patch | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/patches/JIT-less-toggle.patch b/build/patches/JIT-less-toggle.patch index e322c6e1..d47fb91c 100644 --- a/build/patches/JIT-less-toggle.patch +++ b/build/patches/JIT-less-toggle.patch @@ -7,8 +7,8 @@ Subject: JIT-less toggle .../browser/privacy/settings/PrivacySettings.java | 12 ++++++++++++ .../ui/android/strings/android_chrome_strings.grd | 7 +++++++ .../browser/BrowserStartupControllerImpl.java | 1 + - .../chromium/content/browser/DeviceUtilsImpl.java | 6 ++++++ - 5 files changed, 31 insertions(+) + .../chromium/content/browser/DeviceUtilsImpl.java | 8 ++++++++ + 5 files changed, 33 insertions(+) diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml @@ -107,13 +107,15 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/Device import org.chromium.base.StrictModeContext; import org.chromium.content_public.common.ContentSwitches; import org.chromium.ui.base.DeviceFormFactor; -@@ -22,4 +23,9 @@ public class DeviceUtilsImpl { +@@ -22,4 +23,11 @@ public class DeviceUtilsImpl { } } } + public static void addJitlessSwitch() { -+ if (ContextUtils.getAppSharedPreferences().getBoolean("force_no_jit", false)) { -+ CommandLine.getInstance().appendSwitchWithValue("js-flags", "--jitless"); ++ try (StrictModeContext ignored = StrictModeContext.allowDiskReads()) { ++ if (ContextUtils.getAppSharedPreferences().getBoolean("force_no_jit", false)) { ++ CommandLine.getInstance().appendSwitchWithValue("js-flags", "--jitless"); ++ } + } + } }