Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -45093,7 +45093,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean); api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -48556,7 +48556,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean); api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -45455,7 +45455,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean); core/java/android/app/Activity.java +25 −6 Original line number Diff line number Diff line Loading @@ -7193,6 +7193,7 @@ public class Activity extends ContextThemeWrapper final View root = getWindow().getDecorView(); final int itemCount = ids.size(); int numApplied = 0; ArrayMap<View, SparseArray<AutofillValue>> virtualValues = null; for (int i = 0; i < itemCount; i++) { final AutofillId id = ids.get(i); Loading @@ -7203,19 +7204,37 @@ public class Activity extends ContextThemeWrapper Log.w(TAG, "autofill(): no View with id " + viewId); continue; } final boolean wasApplied; if (id.isVirtual()) { wasApplied = view.autofill(id.getVirtualChildId(), value); final int parentId = id.getViewId(); if (virtualValues == null) { // Most likely there will be just one view with virtual children. virtualValues = new ArrayMap<>(1); } SparseArray<AutofillValue> valuesByParent = virtualValues.get(view); if (valuesByParent == null) { // We don't know the size yet, but usually it will be just a few fields... valuesByParent = new SparseArray<>(5); virtualValues.put(view, valuesByParent); } valuesByParent.put(id.getVirtualChildId(), value); } else { wasApplied = view.autofill(value); if (view.autofill(value)) { numApplied++; } } } if (wasApplied) { numApplied++; if (virtualValues != null) { for (int i = 0; i < virtualValues.size(); i++) { final View parent = virtualValues.keyAt(i); final SparseArray<AutofillValue> childrenValues = virtualValues.valueAt(i); if (parent.autofill(childrenValues)) { numApplied += childrenValues.size(); } } } LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount); log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied); mMetricsLogger.write(log); Loading core/java/android/view/View.java +6 −7 Original line number Diff line number Diff line Loading @@ -7379,7 +7379,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * <p>When implementing this method, subclasses must follow the rules below: * * <ol> * <li>Also implement {@link #autofill(int, AutofillValue)} to autofill the virtual * <li>Also implement {@link #autofill(SparseArray)} to autofill the virtual * children. * <li>Call * {@link android.view.autofill.AutofillManager#notifyViewEntered} and Loading Loading @@ -7448,24 +7448,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** * Automatically fills the content of a virtual view with the {@code value} * Automatically fills the content of a virtual views. * * <p>See {@link #autofill(AutofillValue)} and * {@link #onProvideAutofillVirtualStructure(ViewStructure, int)} for more info. * * @param value value to be autofilled. * @param virtualId id identifying the virtual child inside the custom view. * @param values map of values to be autofilled, keyed by virtual child id. * * @return {@code true} if the view was successfully autofilled, {@code false} otherwise */ public boolean autofill(@SuppressWarnings("unused") int virtualId, @SuppressWarnings("unused") AutofillValue value) { public boolean autofill( @NonNull @SuppressWarnings("unused") SparseArray<AutofillValue>values) { return false; } /** * Describes the autofill type that should be used on calls to * {@link #autofill(AutofillValue)} and {@link #autofill(int, AutofillValue)}. * {@link #autofill(AutofillValue)} and {@link #autofill(SparseArray)}. * * <p>By default returns {@link #AUTOFILL_TYPE_NONE}, but views should override it (and * {@link #autofill(AutofillValue)} to support the Autofill Framework. Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -45093,7 +45093,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean);
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -48556,7 +48556,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean);
api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -45455,7 +45455,7 @@ package android.view { method public android.view.ViewPropertyAnimator animate(); method public void announceForAccessibility(java.lang.CharSequence); method public boolean autofill(android.view.autofill.AutofillValue); method public boolean autofill(int, android.view.autofill.AutofillValue); method public boolean autofill(android.util.SparseArray<android.view.autofill.AutofillValue>); method protected boolean awakenScrollBars(); method protected boolean awakenScrollBars(int); method protected boolean awakenScrollBars(int, boolean);
core/java/android/app/Activity.java +25 −6 Original line number Diff line number Diff line Loading @@ -7193,6 +7193,7 @@ public class Activity extends ContextThemeWrapper final View root = getWindow().getDecorView(); final int itemCount = ids.size(); int numApplied = 0; ArrayMap<View, SparseArray<AutofillValue>> virtualValues = null; for (int i = 0; i < itemCount; i++) { final AutofillId id = ids.get(i); Loading @@ -7203,19 +7204,37 @@ public class Activity extends ContextThemeWrapper Log.w(TAG, "autofill(): no View with id " + viewId); continue; } final boolean wasApplied; if (id.isVirtual()) { wasApplied = view.autofill(id.getVirtualChildId(), value); final int parentId = id.getViewId(); if (virtualValues == null) { // Most likely there will be just one view with virtual children. virtualValues = new ArrayMap<>(1); } SparseArray<AutofillValue> valuesByParent = virtualValues.get(view); if (valuesByParent == null) { // We don't know the size yet, but usually it will be just a few fields... valuesByParent = new SparseArray<>(5); virtualValues.put(view, valuesByParent); } valuesByParent.put(id.getVirtualChildId(), value); } else { wasApplied = view.autofill(value); if (view.autofill(value)) { numApplied++; } } } if (wasApplied) { numApplied++; if (virtualValues != null) { for (int i = 0; i < virtualValues.size(); i++) { final View parent = virtualValues.keyAt(i); final SparseArray<AutofillValue> childrenValues = virtualValues.valueAt(i); if (parent.autofill(childrenValues)) { numApplied += childrenValues.size(); } } } LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED); log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount); log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VIEWS_FILLED, numApplied); mMetricsLogger.write(log); Loading
core/java/android/view/View.java +6 −7 Original line number Diff line number Diff line Loading @@ -7379,7 +7379,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * <p>When implementing this method, subclasses must follow the rules below: * * <ol> * <li>Also implement {@link #autofill(int, AutofillValue)} to autofill the virtual * <li>Also implement {@link #autofill(SparseArray)} to autofill the virtual * children. * <li>Call * {@link android.view.autofill.AutofillManager#notifyViewEntered} and Loading Loading @@ -7448,24 +7448,23 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } /** * Automatically fills the content of a virtual view with the {@code value} * Automatically fills the content of a virtual views. * * <p>See {@link #autofill(AutofillValue)} and * {@link #onProvideAutofillVirtualStructure(ViewStructure, int)} for more info. * * @param value value to be autofilled. * @param virtualId id identifying the virtual child inside the custom view. * @param values map of values to be autofilled, keyed by virtual child id. * * @return {@code true} if the view was successfully autofilled, {@code false} otherwise */ public boolean autofill(@SuppressWarnings("unused") int virtualId, @SuppressWarnings("unused") AutofillValue value) { public boolean autofill( @NonNull @SuppressWarnings("unused") SparseArray<AutofillValue>values) { return false; } /** * Describes the autofill type that should be used on calls to * {@link #autofill(AutofillValue)} and {@link #autofill(int, AutofillValue)}. * {@link #autofill(AutofillValue)} and {@link #autofill(SparseArray)}. * * <p>By default returns {@link #AUTOFILL_TYPE_NONE}, but views should override it (and * {@link #autofill(AutofillValue)} to support the Autofill Framework. Loading