diff options
| author | Felipe Leme <felipeal@google.com> | 2017-02-22 15:02:03 -0800 |
|---|---|---|
| committer | Felipe Leme <felipeal@google.com> | 2017-02-22 16:09:50 -0800 |
| commit | d09ccb8db6c541f2d349b923bf9b38f1081aaa8d (patch) | |
| tree | 6456904cca450a62462394f6a527c13331d1b699 /core/java/android/widget/AdapterView.java | |
| parent | fc5cbc90cf9708fd7ab7a34e8c2925db2028854e (diff) | |
Added auto-fill support for Spinner.
Spinner is a special kind of list-value field because its auto-fillable
values are not currently present in the assist structure: this change
adds a getAutoFillOptions() to fill that void, and implements the
auto-fill APIs on Spinner.
It also fixes RadioGroup.getAutoFillValue() - it should return the index
of the child, not its resource id.
Bug: 33550221
Test: CtsAutoFillServiceTestCases (with new tests) pass
Change-Id: I625e7dd705fade56fda490fcd3c4446c0c245ee1
Diffstat (limited to 'core/java/android/widget/AdapterView.java')
| -rw-r--r-- | core/java/android/widget/AdapterView.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java index 2cfefba10c57..0b3cff10d17e 100644 --- a/core/java/android/widget/AdapterView.java +++ b/core/java/android/widget/AdapterView.java @@ -34,6 +34,7 @@ import android.view.ViewHierarchyEncoder; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; +import android.view.autofill.AutoFillManager; /** * An AdapterView is a view whose children are determined by an {@link Adapter}. @@ -914,6 +915,11 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { dispatchOnItemSelected(); } } + // Always notify AutoFillManager - it will return right away if auto-fill is disabled. + final AutoFillManager afm = mContext.getSystemService(AutoFillManager.class); + if (afm != null) { + afm.valueChanged(this); + } } private void dispatchOnItemSelected() { |
