Skip to content

Commit 457ec9e

Browse files
committed
Always create nodes for views backed by an adapter.
Some views are backed by adapter and if the adapter changed but views are not updated we were not reporting the views. This is not correct as the accessibility layer should always access whatever is on the screen regardless if we know it will change in the next layout pass. bug:20920903 Change-Id: I5851c886848e7b8e59b76419c22124790d7e6f05
1 parent 2dcfc7a commit 457ec9e

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

core/java/android/widget/AbsListView.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,13 +1556,6 @@ public View findViewByAccessibilityIdTraversal(int accessibilityId) {
15561556
if (accessibilityId == getAccessibilityViewId()) {
15571557
return this;
15581558
}
1559-
// If the data changed the children are invalid since the data model changed.
1560-
// Hence, we pretend they do not exist. After a layout the children will sync
1561-
// with the model at which point we notify that the accessibility state changed,
1562-
// so a service will be able to re-fetch the views.
1563-
if (mDataChanged) {
1564-
return null;
1565-
}
15661559
return super.findViewByAccessibilityIdTraversal(accessibilityId);
15671560
}
15681561

@@ -2408,18 +2401,6 @@ private void setItemViewLayoutParams(View child, int position) {
24082401
}
24092402

24102403
class ListItemAccessibilityDelegate extends AccessibilityDelegate {
2411-
@Override
2412-
public AccessibilityNodeInfo createAccessibilityNodeInfo(View host) {
2413-
// If the data changed the children are invalid since the data model changed.
2414-
// Hence, we pretend they do not exist. After a layout the children will sync
2415-
// with the model at which point we notify that the accessibility state changed,
2416-
// so a service will be able to re-fetch the views.
2417-
if (mDataChanged) {
2418-
return null;
2419-
}
2420-
return super.createAccessibilityNodeInfo(host);
2421-
}
2422-
24232404
@Override
24242405
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
24252406
super.onInitializeAccessibilityNodeInfo(host, info);

0 commit comments

Comments
 (0)