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
This commit is contained in:
@@ -6279,8 +6279,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
||||
invalidate();
|
||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
|
||||
notifyAccessibilityStateChanged();
|
||||
// Clear the text navigation state.
|
||||
setAccessibilityCursorPosition(ACCESSIBILITY_CURSOR_POSITION_UNDEFINED);
|
||||
}
|
||||
// Clear the global reference of accessibility focus if this
|
||||
// view or any of its descendants had accessibility focus.
|
||||
@@ -6327,7 +6325,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
||||
void clearAccessibilityFocusNoCallbacks() {
|
||||
if ((mPrivateFlags2 & ACCESSIBILITY_FOCUSED) != 0) {
|
||||
mPrivateFlags2 &= ~ACCESSIBILITY_FOCUSED;
|
||||
setAccessibilityCursorPosition(ACCESSIBILITY_CURSOR_POSITION_UNDEFINED);
|
||||
invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user