summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/service/autofill/AutofillService.java2
-rw-r--r--core/java/android/service/autofill/FillRequest.java13
-rw-r--r--core/java/android/service/autofill/FillResponse.java25
-rw-r--r--core/java/android/service/autofill/SaveRequest.java5
-rw-r--r--core/java/android/service/autofill/Validators.java8
5 files changed, 31 insertions, 22 deletions
diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java
index 1afa8b3eb4dd..97fdcefc9d56 100644
--- a/core/java/android/service/autofill/AutofillService.java
+++ b/core/java/android/service/autofill/AutofillService.java
@@ -445,7 +445,7 @@ import com.android.internal.os.SomeArgs;
*
* <p>The {@link #onFillRequest(FillRequest, CancellationSignal, FillCallback)} method is called
* without the user content. The Android system strips some properties of the
- * {@link android.app.assist.AssistStructure.ViewNode view nodes} passed to these calls, but not all
+ * {@link android.app.assist.AssistStructure.ViewNode view nodes} passed to this call, but not all
* of them. For example, the data provided in the {@link android.view.ViewStructure.HtmlInfo}
* objects set by {@link android.webkit.WebView} is never stripped out.
*
diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java
index 3a84224084c0..ddc92f6a656f 100644
--- a/core/java/android/service/autofill/FillRequest.java
+++ b/core/java/android/service/autofill/FillRequest.java
@@ -127,12 +127,15 @@ public final class FillRequest implements Parcelable {
}
/**
- * Gets the extra client state returned from the last {@link
- * AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, FillCallback)
- * fill request}, so the service can use it for state management.
+ * Gets the latest client state bundle set by the service in a
+ * {@link FillResponse.Builder#setClientState(Bundle) fill response}.
*
- * <p>Once a {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)
- * save request} is made, the client state is cleared.
+ * <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state
+ * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On
+ * Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of
+ * an authenticated request through the
+ * {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are
+ * also considered (and take precedence when set).
*
* @return The client state.
*/
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 06d2b07eef09..04db69845c86 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -49,14 +49,16 @@ import java.util.List;
public final class FillResponse implements Parcelable {
/**
- * Must be set in the last response to generate
- * {@link FillEventHistory.Event#TYPE_CONTEXT_COMMITTED} events.
+ * Flag used to generate {@link FillEventHistory.Event events} of type
+ * {@link FillEventHistory.Event#TYPE_CONTEXT_COMMITTED}&mdash;if this flag is not passed to
+ * {@link Builder#setFlags(int)}, these events are not generated.
*/
public static final int FLAG_TRACK_CONTEXT_COMMITED = 0x1;
/**
- * Used in conjunction to {@link FillResponse.Builder#disableAutofill(long)} to disable autofill
- * only for the activiy associated with the {@link FillResponse}, instead of the whole app.
+ * Flag used to change the behavior of {@link FillResponse.Builder#disableAutofill(long)}&mdash;
+ * when this flag is passed to {@link Builder#setFlags(int)}, autofill is disabled only for the
+ * activiy that generated the {@link FillRequest}, not the whole app.
*/
public static final int FLAG_DISABLE_ACTIVITY_ONLY = 0x2;
@@ -329,19 +331,16 @@ public final class FillResponse implements Parcelable {
}
/**
- * Sets a {@link Bundle state} that will be passed to subsequent APIs that
- * manipulate this response. For example, they are passed to subsequent
- * calls to {@link AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal,
- * FillCallback)} and {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)}.
- * You can use this to store intermediate state that is persistent across multiple
- * fill requests and the subsequent save request.
+ * Sets a bundle with state that is passed to subsequent APIs that manipulate this response.
+ *
+ * <p>You can use this bundle to store intermediate state that is passed to subsequent calls
+ * to {@link AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal,
+ * FillCallback)} and {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)}, and
+ * you can also retrieve it by calling {@link FillEventHistory.Event#getClientState()}.
*
* <p>If this method is called on multiple {@link FillResponse} objects for the same
* screen, just the latest bundle is passed back to the service.
*
- * <p>Once a {@link AutofillService#onSaveRequest(SaveRequest, SaveCallback)
- * save request} is made the client state is cleared.
- *
* @param clientState The custom client state.
* @return This builder.
*/
diff --git a/core/java/android/service/autofill/SaveRequest.java b/core/java/android/service/autofill/SaveRequest.java
index f53967bde773..4f85e6b9b23c 100644
--- a/core/java/android/service/autofill/SaveRequest.java
+++ b/core/java/android/service/autofill/SaveRequest.java
@@ -59,10 +59,11 @@ public final class SaveRequest implements Parcelable {
}
/**
- * Gets the latest client state extra returned from the service.
+ * Gets the latest client state bundle set by the service in a
+ * {@link FillResponse.Builder#setClientState(Bundle) fill response}.
*
* <p><b>Note:</b> Prior to Android {@link android.os.Build.VERSION_CODES#P}, only client state
- * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} where considered. On
+ * bundles set by {@link FillResponse.Builder#setClientState(Bundle)} were considered. On
* Android {@link android.os.Build.VERSION_CODES#P} and higher, bundles set in the result of
* an authenticated request through the
* {@link android.view.autofill.AutofillManager#EXTRA_CLIENT_STATE} extra are
diff --git a/core/java/android/service/autofill/Validators.java b/core/java/android/service/autofill/Validators.java
index 1c8386870fe7..0f1ba9891a99 100644
--- a/core/java/android/service/autofill/Validators.java
+++ b/core/java/android/service/autofill/Validators.java
@@ -33,6 +33,8 @@ public final class Validators {
/**
* Creates a validator that is only valid if all {@code validators} are valid.
*
+ * <p>Used to represent an {@code AND} boolean operation in a chain of validators.
+ *
* @throws IllegalArgumentException if any element of {@code validators} is an instance of a
* class that is not provided by the Android System.
*/
@@ -44,6 +46,8 @@ public final class Validators {
/**
* Creates a validator that is valid if any of the {@code validators} is valid.
*
+ * <p>Used to represent an {@code OR} boolean operation in a chain of validators.
+ *
* @throws IllegalArgumentException if any element of {@code validators} is an instance of a
* class that is not provided by the Android System.
*/
@@ -53,7 +57,9 @@ public final class Validators {
}
/**
- * Creates a validator that is valid only if {@code validator} is not.
+ * Creates a validator that is valid when {@code validator} is not, and vice versa.
+ *
+ * <p>Used to represent a {@code NOT} boolean operation in a chain of validators.
*
* @throws IllegalArgumentException if {@code validator} is an instance of a class that is not
* provided by the Android System.