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

Commit 7e4c205d authored by Felipe Leme's avatar Felipe Leme
Browse files

Moved getAutofillOptions() logic from SpinnerAbs to AdapterView and Adapter.

Fixes: 37330022
Test: CtsAutoFillServiceTestCases pass
Test: manual verification using app from bug 37327881

Change-Id: I66260131c7ef0d5b3c2b20514f29efd5eb10057e
parent 4b0d2bf7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -6626,7 +6626,7 @@ package android.app.assist {
    method public float getAlpha();
    method public java.lang.String[] getAutofillHints();
    method public android.view.autofill.AutofillId getAutofillId();
    method public java.lang.String[] getAutofillOptions();
    method public java.lang.CharSequence[] getAutofillOptions();
    method public int getAutofillType();
    method public android.view.autofill.AutofillValue getAutofillValue();
    method public android.app.assist.AssistStructure.ViewNode getChildAt(int);
@@ -46550,7 +46550,7 @@ package android.view {
    method public abstract void setAlpha(float);
    method public abstract void setAutofillHints(java.lang.String[]);
    method public abstract void setAutofillId(android.view.ViewStructure, int);
    method public abstract void setAutofillOptions(java.lang.String[]);
    method public abstract void setAutofillOptions(java.lang.CharSequence[]);
    method public abstract void setAutofillType(int);
    method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
    method public abstract void setCheckable(boolean);
@@ -49371,6 +49371,7 @@ package android.widget {
  }
  public abstract interface Adapter {
    method public default java.lang.CharSequence[] getAutofillOptions();
    method public abstract int getCount();
    method public abstract java.lang.Object getItem(int);
    method public abstract long getItemId(int);
@@ -49520,6 +49521,7 @@ package android.widget {
    method public void addAll(T...);
    method public void clear();
    method public static android.widget.ArrayAdapter<java.lang.CharSequence> createFromResource(android.content.Context, int, int);
    method public java.lang.CharSequence[] getAutofillOptions();
    method public android.content.Context getContext();
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
+4 −2
Original line number Diff line number Diff line
@@ -6871,7 +6871,7 @@ package android.app.assist {
    method public float getAlpha();
    method public java.lang.String[] getAutofillHints();
    method public android.view.autofill.AutofillId getAutofillId();
    method public java.lang.String[] getAutofillOptions();
    method public java.lang.CharSequence[] getAutofillOptions();
    method public int getAutofillType();
    method public android.view.autofill.AutofillValue getAutofillValue();
    method public android.app.assist.AssistStructure.ViewNode getChildAt(int);
@@ -50125,7 +50125,7 @@ package android.view {
    method public abstract void setAlpha(float);
    method public abstract void setAutofillHints(java.lang.String[]);
    method public abstract void setAutofillId(android.view.ViewStructure, int);
    method public abstract void setAutofillOptions(java.lang.String[]);
    method public abstract void setAutofillOptions(java.lang.CharSequence[]);
    method public abstract void setAutofillType(int);
    method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
    method public abstract void setCheckable(boolean);
@@ -53314,6 +53314,7 @@ package android.widget {
  }
  public abstract interface Adapter {
    method public default java.lang.CharSequence[] getAutofillOptions();
    method public abstract int getCount();
    method public abstract java.lang.Object getItem(int);
    method public abstract long getItemId(int);
@@ -53463,6 +53464,7 @@ package android.widget {
    method public void addAll(T...);
    method public void clear();
    method public static android.widget.ArrayAdapter<java.lang.CharSequence> createFromResource(android.content.Context, int, int);
    method public java.lang.CharSequence[] getAutofillOptions();
    method public android.content.Context getContext();
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
+4 −2
Original line number Diff line number Diff line
@@ -6656,7 +6656,7 @@ package android.app.assist {
    method public float getAlpha();
    method public java.lang.String[] getAutofillHints();
    method public android.view.autofill.AutofillId getAutofillId();
    method public java.lang.String[] getAutofillOptions();
    method public java.lang.CharSequence[] getAutofillOptions();
    method public int getAutofillType();
    method public android.view.autofill.AutofillValue getAutofillValue();
    method public android.app.assist.AssistStructure.ViewNode getChildAt(int);
@@ -46924,7 +46924,7 @@ package android.view {
    method public abstract void setAlpha(float);
    method public abstract void setAutofillHints(java.lang.String[]);
    method public abstract void setAutofillId(android.view.ViewStructure, int);
    method public abstract void setAutofillOptions(java.lang.String[]);
    method public abstract void setAutofillOptions(java.lang.CharSequence[]);
    method public abstract void setAutofillType(int);
    method public abstract void setAutofillValue(android.view.autofill.AutofillValue);
    method public abstract void setCheckable(boolean);
@@ -49749,6 +49749,7 @@ package android.widget {
  }
  public abstract interface Adapter {
    method public default java.lang.CharSequence[] getAutofillOptions();
    method public abstract int getCount();
    method public abstract java.lang.Object getItem(int);
    method public abstract long getItemId(int);
@@ -49898,6 +49899,7 @@ package android.widget {
    method public void addAll(T...);
    method public void clear();
    method public static android.widget.ArrayAdapter<java.lang.CharSequence> createFromResource(android.content.Context, int, int);
    method public java.lang.CharSequence[] getAutofillOptions();
    method public android.content.Context getContext();
    method public int getCount();
    method public android.content.res.Resources.Theme getDropDownViewTheme();
+5 −5
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ public class AssistStructure implements Parcelable {
        @View.AutofillType int mAutofillType;
        @Nullable String[] mAutofillHints;
        AutofillValue mAutofillValue;
        String[] mAutofillOptions;
        CharSequence[] mAutofillOptions;
        boolean mSanitized;
        HtmlInfo mHtmlInfo;

@@ -689,7 +689,7 @@ public class AssistStructure implements Parcelable {
                mAutofillType = in.readInt();
                mAutofillHints = in.readStringArray();
                mAutofillValue = in.readParcelable(null);
                mAutofillOptions = in.readStringArray();
                mAutofillOptions = in.readCharSequenceArray();
                final Parcelable p = in.readParcelable(null);
                if (p instanceof HtmlInfo) {
                    mHtmlInfo = (HtmlInfo) p;
@@ -850,7 +850,7 @@ public class AssistStructure implements Parcelable {
                    sanitizedValue = null;
                }
                out.writeParcelable(sanitizedValue,  0);
                out.writeStringArray(mAutofillOptions);
                out.writeCharSequenceArray(mAutofillOptions);
                if (mHtmlInfo instanceof Parcelable) {
                    out.writeParcelable((Parcelable) mHtmlInfo, 0);
                } else {
@@ -1002,7 +1002,7 @@ public class AssistStructure implements Parcelable {
         * <p>It's only set when the {@link AssistStructure} is used for autofilling purposes, not
         * for assist.
         */
        public String[] getAutofillOptions() {
        public CharSequence[] getAutofillOptions() {
            return mAutofillOptions;
        }

@@ -1694,7 +1694,7 @@ public class AssistStructure implements Parcelable {
        }

        @Override
        public void setAutofillOptions(String[] options) {
        public void setAutofillOptions(CharSequence[] options) {
            mNode.mAutofillOptions = options;
        }

+2 −1
Original line number Diff line number Diff line
@@ -7261,7 +7261,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * <li>The view contents does not include PII (Personally Identifiable Information), so it
     * can call {@link ViewStructure#setDataIsSensitive(boolean)} passing {@code false}.
     * <li>It must set fields such {@link ViewStructure#setText(CharSequence)},
     * {@link ViewStructure#setAutofillOptions(String[])}, or {@link ViewStructure#setUrl(String)}.
     * {@link ViewStructure#setAutofillOptions(CharSequence[])},
     * or {@link ViewStructure#setUrl(String)}.
     * </ol>
     *
     * @param structure Fill in with structured view data. The default implementation
Loading