summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Rupert Ben Wiser <bewise@chromium.org> 2023-03-15 12:13:15 +0000
committer Ben Wiser <bewise@google.com> 2023-03-22 14:56:12 +0000
commit2d0baafa9a3c3eeefd3ef1d0306b96725e5a005a (patch)
treefa78c6ac8ba56878e9c65fa653c370780a0b4364
parent2faeca44985fccf2134852e7995406c32e6d37b8 (diff)
webkit: Add note about HttpAuthHandler being called from Ui
Test: N/A Bug: 271077519 Change-Id: I8c4bd4ffee6508e3ca1be18b9182b662722f7370
-rw-r--r--core/java/android/webkit/HttpAuthHandler.java9
-rw-r--r--core/java/android/webkit/WebViewClient.java3
2 files changed, 12 insertions, 0 deletions
diff --git a/core/java/android/webkit/HttpAuthHandler.java b/core/java/android/webkit/HttpAuthHandler.java
index 5353bc6983ee..715fc9abe4ba 100644
--- a/core/java/android/webkit/HttpAuthHandler.java
+++ b/core/java/android/webkit/HttpAuthHandler.java
@@ -41,6 +41,9 @@ public class HttpAuthHandler extends Handler {
* are suitable for use. Credentials are not suitable if they have
* previously been rejected by the server for the current request.
*
+ * <p class="note"><b>Note:</b> The host application must call this method
+ * on the host application's UI Thread.
+ *
* @return whether the credentials are suitable for use
* @see WebView#getHttpAuthUsernamePassword
*/
@@ -50,6 +53,9 @@ public class HttpAuthHandler extends Handler {
/**
* Instructs the WebView to cancel the authentication request.
+ *
+ * <p class="note"><b>Note:</b> The host application must call this method
+ * on the host application's UI Thread.
*/
public void cancel() {
}
@@ -58,6 +64,9 @@ public class HttpAuthHandler extends Handler {
* Instructs the WebView to proceed with the authentication with the given
* credentials. Credentials for use with this method can be retrieved from
* the WebView's store using {@link WebView#getHttpAuthUsernamePassword}.
+ *
+ * <p class="note"><b>Note:</b> The host application must call this method
+ * on the host application's UI Thread.
*/
public void proceed(String username, String password) {
}
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 7b6e1a370479..55f09f110f88 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -455,6 +455,9 @@ public class WebViewClient {
* {@link HttpAuthHandler} to set the WebView's response to the request.
* The default behavior is to cancel the request.
*
+ * <p class="note"><b>Note:</b> The supplied HttpAuthHandler must be used on
+ * the UI thread.
+ *
* @param view the WebView that is initiating the callback
* @param handler the HttpAuthHandler used to set the WebView's response
* @param host the host requiring authentication