summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorGustav Sennton <gsennton@google.com>2018-01-19 11:56:55 +0000
committerGustav Sennton <gsennton@google.com>2018-01-22 22:13:57 +0000
commit265afdb14e1c56b254b4ea96c7ba11a9e0fa73e6 (patch)
tree03cbaeb6606c2938dc8db6d11d9a252b7920ca98 /core/java/android/webkit/WebView.java
parent8f0d71e3ee99cb3cee8409ec7b5448282aaadce7 (diff)
Add a method for fetching the WebView classloader.
The WebView Support Library needs a way to hook into the WebView APK, this new method returns a classloader that can be used to load internal WebView classes. The idea is to have this classloader be provided by the WebView APK itself, so that the classes accessed from the classloader can be filtered to avoid apps accidentally adding dependencies on internal details of the WebView APK. Test: N/A - cannot add CTS tests until we drop a WebView APK containing the implementation for this API. Bug: 38220806 Change-Id: If744a740ff0b1728d2d4674e73697bc6a5e27dde
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index deb94e816a69..00860a42a546 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2412,6 +2412,16 @@ public class WebView extends AbsoluteLayout
return mProvider.getTextClassifier();
}
+ /**
+ * Returns the {@link ClassLoader} used to load internal WebView classes.
+ * This method is meant for use by the WebView Support Library, there is no reason to use this
+ * method otherwise.
+ */
+ @NonNull
+ public static ClassLoader getWebViewClassLoader() {
+ return getFactory().getWebViewClassLoader();
+ }
+
//-------------------------------------------------------------------------
// Interface for WebView providers
//-------------------------------------------------------------------------