Skip to content

Commit 525ae20

Browse files
committed
Accessibility focus and input focus do not sync - part 2
1. This patch has somecode that syncs input and accessibility focus or tries to put accessibility focus on the top most container that was missed by the previous patch. Change-Id: I08f21670b1c6e9f363d5714b1976fb52d84baae4
1 parent f76a83c commit 525ae20

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

core/java/android/view/View.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6212,15 +6212,6 @@ public void clearAccessibilityFocus() {
62126212

62136213
// Clear the text navigation state.
62146214
setAccessibilityCursorPosition(-1);
6215-
6216-
// Try to move accessibility focus to the input focus.
6217-
View rootView = getRootView();
6218-
if (rootView != null) {
6219-
View inputFocus = rootView.findFocus();
6220-
if (inputFocus != null) {
6221-
inputFocus.requestAccessibilityFocus();
6222-
}
6223-
}
62246215
}
62256216
}
62266217

core/java/android/view/ViewRootImpl.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,20 +2993,6 @@ public void handleMessage(Message msg) {
29932993
if (hasWindowFocus) {
29942994
mView.sendAccessibilityEvent(
29952995
AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
2996-
// Give accessibility focus to the view that has input
2997-
// focus if such, otherwise to the first one.
2998-
if (mView instanceof ViewGroup) {
2999-
ViewGroup viewGroup = (ViewGroup) mView;
3000-
View focused = viewGroup.findFocus();
3001-
if (focused != null) {
3002-
focused.requestAccessibilityFocus();
3003-
}
3004-
}
3005-
// There is no accessibility focus, despite our effort
3006-
// above, now just give it to the first view.
3007-
if (mAccessibilityFocusedHost == null) {
3008-
mView.requestAccessibilityFocus();
3009-
}
30102996
}
30112997
}
30122998
}

0 commit comments

Comments
 (0)