Merge "Restart the WebView zygote after a WebView update."
This commit is contained in:
committed by
Android (Google) Code Review
commit
fe447e129f
@@ -163,6 +163,7 @@ class WebViewUpdateServiceImpl {
|
||||
}
|
||||
|
||||
void prepareWebViewInSystemServer() {
|
||||
mSystemInterface.notifyZygote(isMultiProcessEnabled());
|
||||
try {
|
||||
synchronized (mLock) {
|
||||
mCurrentWebViewPackage = findPreferredWebViewPackage();
|
||||
@@ -199,12 +200,6 @@ class WebViewUpdateServiceImpl {
|
||||
Slog.e(TAG, "No valid provider and no fallback available.");
|
||||
}
|
||||
}
|
||||
|
||||
boolean multiProcessEnabled = isMultiProcessEnabled();
|
||||
mSystemInterface.notifyZygote(multiProcessEnabled);
|
||||
if (multiProcessEnabled) {
|
||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(this::startZygoteWhenReady);
|
||||
}
|
||||
}
|
||||
|
||||
private void startZygoteWhenReady() {
|
||||
@@ -358,6 +353,12 @@ class WebViewUpdateServiceImpl {
|
||||
mWebViewPackageDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Once we've notified the system that the provider has changed and started RELRO creation,
|
||||
// try to restart the zygote so that it will be ready when apps use it.
|
||||
if (isMultiProcessEnabled()) {
|
||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(this::startZygoteWhenReady);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user