From b5a9bf41b1900d887fc7cc61bfbe73c3f2a1718c Mon Sep 17 00:00:00 2001 From: Nate Fischer Date: Mon, 11 Sep 2017 15:42:28 -0700 Subject: [PATCH] WebView: document Safe Browsing and shouldInterceptRequest No change to logic, docs only. This documents shouldInterceptRequest request behavior when Safe Browsing is enabled, with recommendations for how this can be avoided depending on the application's needs. Bug: 65555402 Test: make docs (manually verify links all work) Change-Id: I055254bfae3a06061402c519e8740ec4d9779e8f --- core/java/android/webkit/WebViewClient.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java index e7e539c7f01c1..cbe75c405fe48 100644 --- a/core/java/android/webkit/WebViewClient.java +++ b/core/java/android/webkit/WebViewClient.java @@ -154,6 +154,10 @@ public class WebViewClient { * other than the UI thread so clients should exercise caution * when accessing private data or the view system. * + *

Note: when Safe Browsing is enabled, these URLs still undergo Safe Browsing checks. If + * this is undesired, whitelist the URL with {@link WebView#setSafeBrowsingWhitelist} or ignore + * the warning with {@link #onSafeBrowsingHit}. + * * @param view The {@link android.webkit.WebView} that is requesting the * resource. * @param url The raw url of the resource. @@ -177,6 +181,10 @@ public class WebViewClient { * other than the UI thread so clients should exercise caution * when accessing private data or the view system. * + *

Note: when Safe Browsing is enabled, these URLs still undergo Safe Browsing checks. If + * this is undesired, whitelist the URL with {@link WebView#setSafeBrowsingWhitelist} or ignore + * the warning with {@link #onSafeBrowsingHit}. + * * @param view The {@link android.webkit.WebView} that is requesting the * resource. * @param request Object containing the details of the request.