summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorFelipe Leme <felipeal@google.com>2017-07-28 09:14:38 -0700
committerFelipe Leme <felipeal@google.com>2017-07-31 10:18:03 -0700
commit33681a94cff6b48bcf82fda1fcb53b8cf7cd38fe (patch)
tree92f376bbd1bed057c04bff31fa5a1c5d339e25de /core/java
parent81a1d589babb48247689d84c0edb14d9b813297f (diff)
Cherry-picked some Autofill Javadoc improvements from master.
Test: m update-api Bug: 64125551 Bug: 63669555 Bug: 63985284 Merged-in: Iba4817f682670e9fd6d891ae221e1fa415252e99 Change-Id: I82cbb54a522b2cf1dfb11aacc9735c932aa9af90
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/service/autofill/FillResponse.java7
-rw-r--r--core/java/android/view/autofill/AutofillManager.java18
2 files changed, 21 insertions, 4 deletions
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index e13fdf68c831..80ef3aa9ebea 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -205,6 +205,13 @@ public final class FillResponse implements Parcelable {
/**
* Adds a new {@link Dataset} to this response.
*
+ * <p><b>Note: </b> the total number of datasets is limited by the Binder transaction size,
+ * so it's recommended to keep it small (in the range of 10-20 at most) and use pagination
+ * by adding a fake
+ * {@link Dataset.Builder#setAuthentication(IntentSender) authenticated dataset}
+ * at the end with a presentation string like "Next 10" that would return a new
+ * {@link FillResponse} with the next 10 datasets, and so on.
+ *
* @return This builder.
*/
public @NonNull Builder addDataset(@Nullable Dataset dataset) {
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index e1e8317d8ccb..3505c2900bee 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -671,8 +671,13 @@ public final class AutofillManager {
/**
* Called to indicate the current autofill context should be commited.
*
- * <p>For example, when a virtual view is rendering an {@code HTML} page with a form, it should
- * call this method after the form is submitted and another page is rendered.
+ * <p>This method is typically called by {@link View Views} that manage virtual views; for
+ * example, when the view is rendering an {@code HTML} page with a form and virtual views
+ * that represent the HTML elements, it should call this method after the form is submitted and
+ * another page is rendered.
+ *
+ * <p><b>Note:</b> This method does not need to be called on regular application lifecycle
+ * methods such as {@link android.app.Activity#finish()}.
*/
public void commit() {
if (!hasAutofillFeature()) {
@@ -690,8 +695,13 @@ public final class AutofillManager {
/**
* Called to indicate the current autofill context should be cancelled.
*
- * <p>For example, when a virtual view is rendering an {@code HTML} page with a form, it should
- * call this method if the user does not post the form but moves to another form in this page.
+ * <p>This method is typically called by {@link View Views} that manage virtual views; for
+ * example, when the view is rendering an {@code HTML} page with a form and virtual views
+ * that represent the HTML elements, it should call this method if the user does not post the
+ * form but moves to another form in this page.
+ *
+ * <p><b>Note:</b> This method does not need to be called on regular application lifecycle
+ * methods such as {@link android.app.Activity#finish()}.
*/
public void cancel() {
if (!hasAutofillFeature()) {