From 883b165d4815823b673da3bc1fff038b96fc73cf Mon Sep 17 00:00:00 2001 From: LaĆ­s Minchillo Date: Wed, 30 Sep 2020 18:27:08 +0000 Subject: WebView: update loadUrl documentation No change to logic, only docs. Updates loadUrl documentation to make it clear that some WebView versions require the Map parameter to be mutable. Bug: 145881245 Test: m offline-sdk-docs -j4 Change-Id: I15f3c48f02090b8855880ff5d39c02aa28d4dfa8 --- core/java/android/webkit/WebView.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 052bca57d77c..8eb1371505bf 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -704,18 +704,20 @@ public class WebView extends AbsoluteLayout return mProvider.restoreState(inState); } - /** - * Loads the given URL with the specified additional HTTP headers. + /** + * Loads the given URL with additional HTTP headers, specified as a map from + * name to value. Note that if this map contains any of the headers that are + * set by default by this WebView, such as those controlling caching, accept + * types or the User-Agent, their values may be overridden by this WebView's + * defaults. + *

+ * Some older WebView implementations require {@code additionalHttpHeaders} + * to be mutable. *

* Also see compatibility note on {@link #evaluateJavascript}. * * @param url the URL of the resource to load - * @param additionalHttpHeaders the additional headers to be used in the - * HTTP request for this URL, specified as a map from name to - * value. Note that if this map contains any of the headers - * that are set by default by this WebView, such as those - * controlling caching, accept types or the User-Agent, their - * values may be overridden by this WebView's defaults. + * @param additionalHttpHeaders map with additional headers */ public void loadUrl(@NonNull String url, @NonNull Map additionalHttpHeaders) { checkThread(); -- cgit v1.2.3-59-g8ed1b