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
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user