summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Torne (Richard Coles) <torne@google.com> 2019-04-25 13:30:37 -0400
committer Torne (Richard Coles) <torne@google.com> 2019-04-25 13:30:37 -0400
commit1bc38eda65a9270d555967f3e00575817878e6e8 (patch)
tree5807372f4d3da6159e536e5ce088d2a82326ba10
parentaeb929a3f97a854bb7748df50c7e09bb1b5a9117 (diff)
Only start WebView zygote if multiprocess enabled.
The fix for b/130305037 inadvertantly changed the behaviour of the webview zygote for devices which have multiprocess WebView disabled: the zygote was being started at boot time even if it would not be needed. Only call the function to start the zygote if multiprocess is actually enabled, to fix this. Fixes: 131267737 Test: adb shell cmd webviewupdate disable-multiprocess; adb reboot Change-Id: Iccda48b75d75259821dba6b002339b2d6c8e3394
-rw-r--r--services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
index 890456aa6e9c..476a27309f7e 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdateServiceImpl.java
@@ -81,8 +81,11 @@ public class WebViewUpdateServiceImpl {
void prepareWebViewInSystemServer() {
migrateFallbackStateOnBoot();
mWebViewUpdater.prepareWebViewInSystemServer();
- mSystemInterface.notifyZygote(isMultiProcessEnabled());
- AsyncTask.THREAD_POOL_EXECUTOR.execute(this::startZygoteWhenReady);
+ boolean multiProcessEnabled = isMultiProcessEnabled();
+ mSystemInterface.notifyZygote(multiProcessEnabled);
+ if (multiProcessEnabled) {
+ AsyncTask.THREAD_POOL_EXECUTOR.execute(this::startZygoteWhenReady);
+ }
}
void startZygoteWhenReady() {