Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5df5e226 authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Allow disk reads during more parts of WebView loading.

Loading WebView should not cause any StrictMode violations since app
developers using WebView with StrictMode turned on would have to turn
off StrictMode violations at the point at which they create a new
WebView.

Bug: 27240115

Change-Id: Ia2f5565be6f36560bc9881624faf6645bc2c8575
parent f72ecded
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -262,11 +262,11 @@ public final class WebViewFactory {
                        "For security reasons, WebView is not allowed in privileged processes");
            }

            StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
            Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "WebViewFactory.getProvider()");
            try {
                Class<WebViewFactoryProvider> providerClass = getProviderClass();

                StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
                Trace.traceBegin(Trace.TRACE_TAG_WEBVIEW, "providerClass.newInstance()");
                try {
                    sProviderInstance = providerClass.getConstructor(WebViewDelegate.class)
@@ -278,10 +278,10 @@ public final class WebViewFactory {
                    throw new AndroidRuntimeException(e);
                } finally {
                    Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
                    StrictMode.setThreadPolicy(oldPolicy);
                }
            } finally {
                Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW);
                StrictMode.setThreadPolicy(oldPolicy);
            }
        }
    }