Skip to content

Commit 0a047bd

Browse files
committed
Accessibility focus should not clear selection when taken away.
1. Currently accessibility focus removal was clearing the selection in the view - in particular the accessibility cursor position which in the TextView case is the selection. This leads to a scenario where the selection may be cleared when the app does not explect. Further, the selection should not be cleared since the user can be say several pages in the content and removing and putting back accessibility focus would cause a tedious traversal to get to the previous position. bug:6469840 Change-Id: Iba3c01600fa2c9c39f99085a5fbc4328aa539ea8
1 parent a3404be commit 0a047bd

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

core/java/android/view/View.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6279,8 +6279,6 @@ public void clearAccessibilityFocus() {
62796279
invalidate();
62806280
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
62816281
notifyAccessibilityStateChanged();
6282-
// Clear the text navigation state.
6283-
setAccessibilityCursorPosition(ACCESSIBILITY_CURSOR_POSITION_UNDEFINED);
62846282
}
62856283
// Clear the global reference of accessibility focus if this
62866284
// view or any of its descendants had accessibility focus.
@@ -6327,7 +6325,6 @@ private boolean canTakeAccessibilityFocusFromHover() {
63276325
void clearAccessibilityFocusNoCallbacks() {
63286326
if ((mPrivateFlags2 & ACCESSIBILITY_FOCUSED) != 0) {
63296327
mPrivateFlags2 &= ~ACCESSIBILITY_FOCUSED;
6330-
setAccessibilityCursorPosition(ACCESSIBILITY_CURSOR_POSITION_UNDEFINED);
63316328
invalidate();
63326329
}
63336330
}

0 commit comments

Comments
 (0)