From a96f7af211787d98ccd0ec343f8431ff3ef6e8ce Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Thu, 10 Aug 2017 16:39:02 -0700 Subject: Clarified that getAutofillValue() must return same value passed to autofill(). Test: m doc-comment-check-docs Bug: 64114048 Change-Id: I618cc3703db64315a848cc483f460f1b27fec98b --- core/java/android/view/View.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 25c02d17f046..b2aceca43dc3 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -7452,7 +7452,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link ViewStructure#setAutofillOptions(CharSequence[])}. * * - *

NOTE: the {@code left} and {@code top} values set in + *

Note: The {@code left} and {@code top} values set in * {@link ViewStructure#setDimens(int, int, int, int, int, int)} must be relative to the next * {@link ViewGroup#isImportantForAutofill()} predecessor view included in the structure. * @@ -7690,6 +7690,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@link AutofillManager#notifyValueChanged(View)} must happen after the value was * changed to the autofilled value. If not, the view will not be considered autofilled. * + *

Note: After this method is called, the value returned by + * {@link #getAutofillValue()} must be equal to the {@code value} passed to it, otherwise the + * view will not be highlighted as autofilled. + * * @param value value to be autofilled. */ public void autofill(@SuppressWarnings("unused") AutofillValue value) { @@ -7713,7 +7717,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * after the value was changed to the autofilled value. If not, the child will not be * considered autofilled. * - *

NOTE: to indicate that a virtual view was autofilled, + *

Note: To indicate that a virtual view was autofilled, * ?android:attr/autofilledHighlight should be drawn over it until the data * changes. * @@ -7782,8 +7786,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /** * Gets the {@link View}'s current autofill value. * - *

By default returns {@code null}, but views should override it to properly support the - * Autofill Framework. + *

By default returns {@code null}, but subclasses should override it and return an + * appropriate value to properly support the Autofill Framework. * * @see #onProvideAutofillStructure(ViewStructure, int) * @see #autofill(AutofillValue) @@ -7835,7 +7839,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * be {@link #IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS}. * * - *

NOTE: setting the mode as does {@link #IMPORTANT_FOR_AUTOFILL_NO} or + *

Note: Setting the mode as {@link #IMPORTANT_FOR_AUTOFILL_NO} or * {@link #IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS} does not guarantee the view (and its * children) will be always be considered not important; for example, when the user explicitly * makes an autofill request, all views are considered important. See -- cgit v1.2.3-59-g8ed1b