Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa4c935e authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 239a0c0e: Ensure ViewRootImpl.setAccessibilityFocus() doesn\'t crash when reentrant.

* commit '239a0c0e':
  Ensure ViewRootImpl.setAccessibilityFocus() doesn't crash when reentrant.
parents 72cc297c 239a0c0e
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2709,7 +2709,6 @@ public final class ViewRootImpl implements ViewParent,

            AccessibilityNodeInfo focusNode = mAccessibilityFocusedVirtualView;
            View focusHost = mAccessibilityFocusedHost;
            focusHost.clearAccessibilityFocusNoCallbacks();

            // Wipe the state of the current accessibility focus since
            // the call into the provider to clear accessibility focus
@@ -2719,6 +2718,10 @@ public final class ViewRootImpl implements ViewParent,
            mAccessibilityFocusedHost = null;
            mAccessibilityFocusedVirtualView = null;

            // Clear accessibility focus on the host after clearing state since
            // this method may be reentrant.
            focusHost.clearAccessibilityFocusNoCallbacks();

            AccessibilityNodeProvider provider = focusHost.getAccessibilityNodeProvider();
            if (provider != null) {
                // Invalidate the area of the cleared accessibility focus.