diff options
| author | sallyyuen <sallyyuen@google.com> | 2022-01-26 09:32:51 -0800 |
|---|---|---|
| committer | sallyyuen <sallyyuen@google.com> | 2022-01-28 16:53:53 -0800 |
| commit | bd0e5becea20c09a1e1ef7f206076198813e31aa (patch) | |
| tree | f73dfb270421adbc3c5a070e2d61a427bd749191 /core/java/android/widget/TextView.java | |
| parent | e39055a2d7262d47f0579e90d1221adf4d90a5a2 (diff) | |
Add AccessibilityNodeInfo.isTextSelectable
ACTION_SET_SELECTION is needed on all TextView nodes to reset the
cursor. But some non-edit texts are selectable and need to be
identified by a11y services. ACTION_SET_SELECTION has been on these
nodes for years so to avoid the complexity of breaking this, add a
node property.
Services should use ACTION_SET_SELECTION for nodes where
property=true
Bug: 62058901
Test: atest AccessibilityTextTraversalTest, TextViewTest cts and
core (TextViewTest#testCutShouldNotThrowException keeps failing but
it's unrelated to this change)
Change-Id: Ia825dd806824e663e7fa7d274f51c6bf44f0c2c4
Diffstat (limited to 'core/java/android/widget/TextView.java')
| -rw-r--r-- | core/java/android/widget/TextView.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 0fe06befa789..be51240d2a84 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -12197,6 +12197,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener EXTRA_DATA_RENDERING_INFO_KEY, EXTRA_DATA_TEXT_CHARACTER_LOCATION_KEY )); + info.setTextSelectable(isTextSelectable()); } else { info.setAvailableExtraData(Arrays.asList( EXTRA_DATA_RENDERING_INFO_KEY |
