Merge "webkit: Add note about HttpAuthHandler being called from Ui" into udc-dev am: 0454dcacdc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22094726

Change-Id: Ibfb5954cb84daa9b3dde527695c8be5b2234f46a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ben Wiser
2023-03-23 15:16:59 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 0 deletions

View File

@@ -41,6 +41,9 @@ public class HttpAuthHandler extends Handler {
* are suitable for use. Credentials are not suitable if they have * are suitable for use. Credentials are not suitable if they have
* previously been rejected by the server for the current request. * 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 * @return whether the credentials are suitable for use
* @see WebView#getHttpAuthUsernamePassword * @see WebView#getHttpAuthUsernamePassword
*/ */
@@ -50,6 +53,9 @@ public class HttpAuthHandler extends Handler {
/** /**
* Instructs the WebView to cancel the authentication request. * 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() { public void cancel() {
} }
@@ -58,6 +64,9 @@ public class HttpAuthHandler extends Handler {
* Instructs the WebView to proceed with the authentication with the given * Instructs the WebView to proceed with the authentication with the given
* credentials. Credentials for use with this method can be retrieved from * credentials. Credentials for use with this method can be retrieved from
* the WebView's store using {@link WebView#getHttpAuthUsernamePassword}. * 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) { public void proceed(String username, String password) {
} }

View File

@@ -455,6 +455,9 @@ public class WebViewClient {
* {@link HttpAuthHandler} to set the WebView's response to the request. * {@link HttpAuthHandler} to set the WebView's response to the request.
* The default behavior is to cancel 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 view the WebView that is initiating the callback
* @param handler the HttpAuthHandler used to set the WebView's response * @param handler the HttpAuthHandler used to set the WebView's response
* @param host the host requiring authentication * @param host the host requiring authentication