Skip to content

Commit c5fb580

Browse files
sganovAndroid (Google) Code Review
authored andcommitted
Merge "Accessiblity focus not following input focus and text nav broken." into jb-dev
2 parents 2862988 + 64899e5 commit c5fb580

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/java/android/view/View.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6159,7 +6159,8 @@ public void clearAccessibilityFocus() {
61596159
ViewRootImpl viewRootImpl = getViewRootImpl();
61606160
if (viewRootImpl != null) {
61616161
View focusHost = viewRootImpl.getAccessibilityFocusedHost();
6162-
if (focusHost != null && ViewRootImpl.isViewDescendantOf(focusHost, this)) {
6162+
if (focusHost != null && focusHost != this
6163+
&& ViewRootImpl.isViewDescendantOf(focusHost, this)) {
61636164
viewRootImpl.setAccessibilityFocusedHost(null);
61646165
}
61656166
}
@@ -6637,7 +6638,7 @@ boolean performAccessibilityActionInternal(int action, Bundle arguments) {
66376638

66386639
private boolean nextAtGranularity(int granularity) {
66396640
CharSequence text = getIterableTextForAccessibility();
6640-
if (text != null && text.length() > 0) {
6641+
if (text == null || text.length() == 0) {
66416642
return false;
66426643
}
66436644
TextSegmentIterator iterator = getIteratorForGranularity(granularity);
@@ -6661,7 +6662,7 @@ private boolean nextAtGranularity(int granularity) {
66616662

66626663
private boolean previousAtGranularity(int granularity) {
66636664
CharSequence text = getIterableTextForAccessibility();
6664-
if (text != null && text.length() > 0) {
6665+
if (text == null || text.length() == 0) {
66656666
return false;
66666667
}
66676668
TextSegmentIterator iterator = getIteratorForGranularity(granularity);

0 commit comments

Comments
 (0)