Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3030442b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Simplified autofill() methods by returning void instead of boolean." into oc-dev

parents cd181e63 955e252a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45161,8 +45161,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.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(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+2 −2
Original line number Diff line number Diff line
@@ -48616,8 +48616,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.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(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+2 −2
Original line number Diff line number Diff line
@@ -45535,8 +45535,8 @@ package android.view {
    method public void addTouchables(java.util.ArrayList<android.view.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(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method public void autofill(android.view.autofill.AutofillValue);
    method public void autofill(android.util.SparseArray<android.view.autofill.AutofillValue>);
    method protected boolean awakenScrollBars();
    method protected boolean awakenScrollBars(int);
    method protected boolean awakenScrollBars(int, boolean);
+2 −9
Original line number Diff line number Diff line
@@ -7447,11 +7447,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * </pre>
     *
     * @param value value to be autofilled.
     *
     * @return {@code true} if the view was successfully autofilled, {@code false} otherwise
     */
    public boolean autofill(@SuppressWarnings("unused") AutofillValue value) {
        return false;
    public void autofill(@SuppressWarnings("unused") AutofillValue value) {
    }
    /**
@@ -7461,12 +7458,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * {@link #onProvideAutofillVirtualStructure(ViewStructure, int)} for more info.
     *
     * @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(
            @NonNull @SuppressWarnings("unused") SparseArray<AutofillValue>values) {
        return false;
    public void autofill(@NonNull @SuppressWarnings("unused") SparseArray<AutofillValue> values) {
    }
    /**
+4 −6
Original line number Diff line number Diff line
@@ -554,21 +554,19 @@ public final class AutofillManager {
                }
                valuesByParent.put(id.getVirtualChildId(), value);
            } else {
                if (view.autofill(value)) {
                view.autofill(value);
                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)) {
                parent.autofill(childrenValues);
                numApplied += childrenValues.size();
            }
        }
        }

        final LogMaker log = new LogMaker(MetricsProto.MetricsEvent.AUTOFILL_DATASET_APPLIED);
        log.addTaggedData(MetricsProto.MetricsEvent.FIELD_AUTOFILL_NUM_VALUES, itemCount);
Loading