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

Commit 955e252a authored by Felipe Leme's avatar Felipe Leme
Browse files

Simplified autofill() methods by returning void instead of boolean.

Test: CtsAutoFillServiceTestCases pass

Change-Id: Ic94e6686e291fed60ef6715bd160f9b568bf0ea6
parent 7ac3fb22
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -45159,8 +45159,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
@@ -48614,8 +48614,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
@@ -45533,8 +45533,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