Merge "AccessibilityNodeInfo reports no children for the topmost view in the tree."

This commit is contained in:
Svetoslav Ganov
2011-07-28 11:09:43 -07:00
committed by Android (Google) Code Review

View File

@@ -2162,7 +2162,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
@Override
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(info);
if ((mPrivateFlags & IS_ROOT_NAMESPACE) != 0) {
// If the view is not the topmost one in the view hierarchy and it is
// marked as the logical root of a view hierarchy, do not go any deeper.
if ((!(getParent() instanceof ViewRootImpl)) && (mPrivateFlags & IS_ROOT_NAMESPACE) != 0) {
return;
}
for (int i = 0, count = mChildrenCount; i < count; i++) {