Merge "Delegate multiprocess flag to WebView update service."

This commit is contained in:
TreeHugger Robot
2017-01-18 15:19:39 +00:00
committed by Android (Google) Code Review

View File

@@ -865,20 +865,16 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
} }
private void updateWebViewMultiprocessOptions() { private void updateWebViewMultiprocessOptions() {
updateSwitchPreference(mWebViewMultiprocess, try {
Settings.Global.getInt(getActivity().getContentResolver(), updateSwitchPreference(mWebViewMultiprocess,
Settings.Global.WEBVIEW_MULTIPROCESS, 0) != 0); mWebViewUpdateService.isMultiProcessEnabled());
} catch (RemoteException e) {
}
} }
private void writeWebViewMultiprocessOptions() { private void writeWebViewMultiprocessOptions() {
boolean value = mWebViewMultiprocess.isChecked();
Settings.Global.putInt(getActivity().getContentResolver(),
Settings.Global.WEBVIEW_MULTIPROCESS, value ? 1 : 0);
try { try {
String wv_package = mWebViewUpdateService.getCurrentWebViewPackageName(); mWebViewUpdateService.enableMultiProcess(mWebViewMultiprocess.isChecked());
ActivityManager.getService().killPackageDependents(
wv_package, UserHandle.USER_ALL);
} catch (RemoteException e) { } catch (RemoteException e) {
} }
} }