Merge "Accessibility window query APIs should respect root name space." into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
6e42470f92
@@ -4171,10 +4171,12 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
||||
bounds.offset(locationOnScreen[0], locationOnScreen[1]);
|
||||
info.setBoundsInScreen(bounds);
|
||||
|
||||
ViewParent parent = getParent();
|
||||
if (parent instanceof View) {
|
||||
View parentView = (View) parent;
|
||||
info.setParent(parentView);
|
||||
if ((mPrivateFlags & IS_ROOT_NAMESPACE) == 0) {
|
||||
ViewParent parent = getParent();
|
||||
if (parent instanceof View) {
|
||||
View parentView = (View) parent;
|
||||
info.setParent(parentView);
|
||||
}
|
||||
}
|
||||
|
||||
info.setPackageName(mContext.getPackageName());
|
||||
|
||||
@@ -2229,14 +2229,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
|
||||
@Override
|
||||
void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
|
||||
super.onInitializeAccessibilityNodeInfoInternal(info);
|
||||
// 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++) {
|
||||
View child = mChildren[i];
|
||||
if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE) {
|
||||
if ((child.mViewFlags & VISIBILITY_MASK) == VISIBLE
|
||||
&& (child.mPrivateFlags & IS_ROOT_NAMESPACE) == 0) {
|
||||
info.addChild(child);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user