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

Commit f4062864 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Accessibility focus and input focus do not sync - part 2" into jb-dev

parents 493743e0 525ae207
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -6212,15 +6212,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
            // Clear the text navigation state.
            setAccessibilityCursorPosition(-1);
            // Try to move accessibility focus to the input focus.
            View rootView = getRootView();
            if (rootView != null) {
                View inputFocus = rootView.findFocus();
                if (inputFocus != null) {
                    inputFocus.requestAccessibilityFocus();
                }
            }
        }
    }
+0 −14
Original line number Diff line number Diff line
@@ -2895,20 +2895,6 @@ public final class ViewRootImpl implements ViewParent,
                        if (hasWindowFocus) {
                            mView.sendAccessibilityEvent(
                                    AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
                            // Give accessibility focus to the view that has input
                            // focus if such, otherwise to the first one.
                            if (mView instanceof ViewGroup) {
                                ViewGroup viewGroup = (ViewGroup) mView;
                                View focused = viewGroup.findFocus();
                                if (focused != null) {
                                    focused.requestAccessibilityFocus();
                                }
                            }
                            // There is no accessibility focus, despite our effort
                            // above, now just give it to the first view.
                            if (mAccessibilityFocusedHost == null) {
                                mView.requestAccessibilityFocus();
                            }
                        }
                    }
                }