diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2017-04-26 15:54:27 -0700 |
|---|---|---|
| committer | Svet Ganov <svetoslavganov@google.com> | 2017-04-27 18:16:08 -0700 |
| commit | fd31f85d0c6f19138d06d565d2b30b59e241a960 (patch) | |
| tree | 2bcef0913360e1d4f52b0f289357f7c336340bca /core/java/android/widget/TextView.java | |
| parent | 54523413f8897c7149a47c5786ab796e0ab0aed1 (diff) | |
Implement the rest of autofill importance modes
Test: CTS tests pass; augmented tests to verify new behavior
bug:36171235
Change-Id: Ieff2b8d7e1c3a3eba456deca7bed70c8e29c415e
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 99b9bd2bfb5f..8626ff396ff6 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -9304,6 +9304,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } private void notifyAutoFillManagerAfterTextChangedIfNeeded() { + // It is important to not check whether the view is important for autofill + // since the user can trigger autofill manually on not important views. if (!isAutofillable()) { return; } @@ -9316,6 +9318,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } + private boolean isAutofillable() { + // It is important to not check whether the view is important for autofill + // since the user can trigger autofill manually on not important views. + return getAutofillType() != AUTOFILL_TYPE_NONE; + } + void updateAfterEdit() { invalidate(); int curs = getSelectionStart(); @@ -10192,6 +10200,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } boolean canRequestAutofill() { + if (!isAutofillable()) { + return false; + } final AutofillManager afm = mContext.getSystemService(AutofillManager.class); if (afm != null) { return afm.isEnabled(); |
