diff options
| author | Nate Fischer <ntfschr@google.com> | 2018-03-26 18:46:31 -0700 |
|---|---|---|
| committer | Nate Fischer <ntfschr@google.com> | 2018-03-26 19:11:30 -0700 |
| commit | db010230c1974866986bd01986f1601dd09961ac (patch) | |
| tree | 2ad8daf3419a520821e5769e82e4efffed3aa1ca /core/java/android/webkit/WebViewClient.java | |
| parent | dcccfd974269e92ee1d4c908018419033bdb0c20 (diff) | |
WebView: clarify shouldInterceptRequest docs
No change to logic, this only changes documentation.
This clarifies how shouldInterceptRequest behaves for various URL
schemes as well as other edge cases (e.g., redirects).
Bug: 74841041
Test: make docs (manually verify)
Change-Id: Id59033590ea6025a00ae39c7b05486be082973e7
Diffstat (limited to 'core/java/android/webkit/WebViewClient.java')
| -rw-r--r-- | core/java/android/webkit/WebViewClient.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index d0f9eee39a03..6df165551f9f 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -152,6 +152,14 @@ public class WebViewClient { * will continue to load the resource as usual. Otherwise, the return * response and data will be used. * + * <p>This callback is invoked for a variety of URL schemes (e.g., {@code http(s):}, {@code + * data:}, {@code file:}, etc.), not only those schemes which send requests over the network. + * This is not called for {@code javascript:} URLs, {@code blob:} URLs, or for assets accessed + * via {@code file:///android_asset/} or {@code file:///android_res/} URLs. + * + * <p>In the case of redirects, this is only called for the initial resource URL, not any + * subsequent redirect URLs. + * * <p class="note"><b>Note:</b> This method is called on a thread * other than the UI thread so clients should exercise caution * when accessing private data or the view system. @@ -182,6 +190,14 @@ public class WebViewClient { * will continue to load the resource as usual. Otherwise, the return * response and data will be used. * + * <p>This callback is invoked for a variety of URL schemes (e.g., {@code http(s):}, {@code + * data:}, {@code file:}, etc.), not only those schemes which send requests over the network. + * This is not called for {@code javascript:} URLs, {@code blob:} URLs, or for assets accessed + * via {@code file:///android_asset/} or {@code file:///android_res/} URLs. + * + * <p>In the case of redirects, this is only called for the initial resource URL, not any + * subsequent redirect URLs. + * * <p class="note"><b>Note:</b> This method is called on a thread * other than the UI thread so clients should exercise caution * when accessing private data or the view system. |
