From effe10fd67645bcaeb987dfefa154c284771064e Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Tue, 26 Jul 2011 18:09:37 -0700 Subject: findViewWithText inconsistent with other findView* methods and AccessibilityNodeInfo not respecting root namespace. 1. Find viewsWithText does not respect if the current view group is a root name space and keeps its traversal. This is inconsistent with the other findView* methods. Also only visible views are returned witch is inconsistent with the other findView* methods. 2. AccessibilityNodeInfo reports children it the source is root namespace. This is not correct since thi flag denotes the beginning of a logically separate view hierarchy. bug:5082601 Change-Id: I9c7ca51f284d04728828d5e656112257c9a2c6e2 --- core/java/android/view/ViewGroup.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/java') diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 8cf03a67a6cd..697636ec7380 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -788,7 +788,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final View[] children = mChildren; for (int i = 0; i < childrenCount; i++) { View child = children[i]; - if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { + if ((child.mPrivateFlags & IS_ROOT_NAMESPACE) == 0) { child.findViewsWithText(outViews, text); } } @@ -2162,6 +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) { + return; + } for (int i = 0, count = mChildrenCount; i < count; i++) { View child = mChildren[i]; if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) { -- cgit v1.2.3