File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -6196,23 +6196,23 @@ public boolean requestAccessibilityFocus() {
61966196 * @hide
61976197 */
61986198 public void clearAccessibilityFocus() {
6199- ViewRootImpl viewRootImpl = getViewRootImpl();
6200- if (viewRootImpl != null) {
6201- View focusHost = viewRootImpl.getAccessibilityFocusedHost();
6202- if (focusHost != null && focusHost != this
6203- && ViewRootImpl.isViewDescendantOf(focusHost, this)) {
6204- viewRootImpl.setAccessibilityFocusedHost(null);
6205- }
6206- }
62076199 if ((mPrivateFlags2 & ACCESSIBILITY_FOCUSED) != 0) {
62086200 mPrivateFlags2 &= ~ACCESSIBILITY_FOCUSED;
62096201 invalidate();
62106202 sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED);
62116203 notifyAccessibilityStateChanged();
6212-
62136204 // Clear the text navigation state.
62146205 setAccessibilityCursorPosition(-1);
62156206 }
6207+ // Clear the global reference of accessibility focus if this
6208+ // view or any of its descendants had accessibility focus.
6209+ ViewRootImpl viewRootImpl = getViewRootImpl();
6210+ if (viewRootImpl != null) {
6211+ View focusHost = viewRootImpl.getAccessibilityFocusedHost();
6212+ if (focusHost != null && ViewRootImpl.isViewDescendantOf(focusHost, this)) {
6213+ viewRootImpl.setAccessibilityFocusedHost(null);
6214+ }
6215+ }
62166216 }
62176217
62186218 private void requestAccessibilityFocusFromHover() {
You can’t perform that action at this time.
0 commit comments