From 457ec9e66810ac5351399ca12897ba0676e607d4 Mon Sep 17 00:00:00 2001 From: Svetoslav Date: Mon, 20 Jul 2015 14:00:58 -0700 Subject: [PATCH] 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 --- core/java/android/widget/AbsListView.java | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index b2b98db25015e..ed858e7a9836d 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -1556,13 +1556,6 @@ public abstract class AbsListView extends AdapterView implements Te if (accessibilityId == getAccessibilityViewId()) { return this; } - // If the data changed the children are invalid since the data model changed. - // Hence, we pretend they do not exist. After a layout the children will sync - // with the model at which point we notify that the accessibility state changed, - // so a service will be able to re-fetch the views. - if (mDataChanged) { - return null; - } return super.findViewByAccessibilityIdTraversal(accessibilityId); } @@ -2408,18 +2401,6 @@ public abstract class AbsListView extends AdapterView implements Te } class ListItemAccessibilityDelegate extends AccessibilityDelegate { - @Override - public AccessibilityNodeInfo createAccessibilityNodeInfo(View host) { - // If the data changed the children are invalid since the data model changed. - // Hence, we pretend they do not exist. After a layout the children will sync - // with the model at which point we notify that the accessibility state changed, - // so a service will be able to re-fetch the views. - if (mDataChanged) { - return null; - } - return super.createAccessibilityNodeInfo(host); - } - @Override public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(host, info);