From b26428b3c25fe64f4bf248e42dc0fa79b0969885 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Mon, 23 Jan 2017 15:09:55 +0000 Subject: [PATCH] Expose isMultiProcessEnabled via WebViewDelegate. Allow the WebView implementation to call isMultiProcessEnabled via the delegate, so that it doesn't have to fetch and interpret the value of the system setting itself. Bug: 21643067 Test: manual (requires modifications to chromium to call) Change-Id: I1ef2b7ea0054c606965040e02034c938d5e6464c --- api/system-current.txt | 1 + core/java/android/webkit/WebViewDelegate.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/api/system-current.txt b/api/system-current.txt index ed52bd1f76e34..63f3c4cf2fbe3 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -50585,6 +50585,7 @@ package android.webkit { method public java.lang.String getErrorString(android.content.Context, int); method public int getPackageId(android.content.res.Resources, java.lang.String); method public void invokeDrawGlFunctor(android.view.View, long, boolean); + method public boolean isMultiProcessEnabled(); method public boolean isTraceTagEnabled(); method public void setOnTraceEnabledChangeListener(android.webkit.WebViewDelegate.OnTraceEnabledChangeListener); } diff --git a/core/java/android/webkit/WebViewDelegate.java b/core/java/android/webkit/WebViewDelegate.java index 2cdff7906462c..92d0d71413701 100644 --- a/core/java/android/webkit/WebViewDelegate.java +++ b/core/java/android/webkit/WebViewDelegate.java @@ -26,6 +26,7 @@ import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.res.Resources; import android.graphics.Canvas; +import android.os.RemoteException; import android.os.SystemProperties; import android.os.Trace; import android.util.SparseArray; @@ -206,4 +207,15 @@ public final class WebViewDelegate { appInfo.getBaseResourcePath(), newAssetPath); } } + + /** + * Returns whether WebView should run in multiprocess mode. + */ + public boolean isMultiProcessEnabled() { + try { + return WebViewFactory.getUpdateService().isMultiProcessEnabled(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } }