Merge "Clearing accessibility focus of a view did not update the global state." into jb-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
321a56c848
@@ -6196,23 +6196,23 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
||||
* @hide
|
||||
*/
|
||||
public void clearAccessibilityFocus() {
|
||||
ViewRootImpl viewRootImpl = getViewRootImpl();
|
||||
if (viewRootImpl != null) {
|
||||
View focusHost = viewRootImpl.getAccessibilityFocusedHost();
|
||||
if (focusHost != null && focusHost != this
|
||||
&& ViewRootImpl.isViewDescendantOf(focusHost, this)) {
|
||||
viewRootImpl.setAccessibilityFocusedHost(null);
|
||||
}
|
||||
}
|
||||
if ((mPrivateFlags2 & ACCESSIBILITY_FOCUSED) != 0) {
|
||||
mPrivateFlags2 &= ~ACCESSIBILITY_FOCUSED;
|
||||
invalidate();
|
||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
|
||||
notifyAccessibilityStateChanged();
|
||||
|
||||
// Clear the text navigation state.
|
||||
setAccessibilityCursorPosition(-1);
|
||||
}
|
||||
// Clear the global reference of accessibility focus if this
|
||||
// view or any of its descendants had accessibility focus.
|
||||
ViewRootImpl viewRootImpl = getViewRootImpl();
|
||||
if (viewRootImpl != null) {
|
||||
View focusHost = viewRootImpl.getAccessibilityFocusedHost();
|
||||
if (focusHost != null && ViewRootImpl.isViewDescendantOf(focusHost, this)) {
|
||||
viewRootImpl.setAccessibilityFocusedHost(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void requestAccessibilityFocusFromHover() {
|
||||
|
||||
Reference in New Issue
Block a user