Loading core/java/android/view/ViewRootImpl.java +16 −13 Original line number Diff line number Diff line Loading @@ -4543,7 +4543,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, predicate.init(accessibilityId); View root = ViewRootImpl.this.mView; View target = root.findViewByPredicate(predicate); if (target != null && target.isShown()) { if (target != null && target.getVisibility() == View.VISIBLE) { info = target.createAccessibilityNodeInfo(); } } finally { Loading Loading @@ -4586,7 +4586,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, try { View root = ViewRootImpl.this.mView; View target = root.findViewById(viewId); if (target != null && target.isShown()) { if (target != null && target.getVisibility() == View.VISIBLE) { info = target.createAccessibilityNodeInfo(); } } finally { Loading Loading @@ -4637,14 +4637,14 @@ public final class ViewRootImpl extends Handler implements ViewParent, ArrayList<View> foundViews = mAttachInfo.mFocusablesTempList; foundViews.clear(); View root; View root = null; if (accessibilityViewId != View.NO_ID) { root = findViewByAccessibilityId(accessibilityViewId); } else { root = ViewRootImpl.this.mView; } if (root == null || !root.isShown()) { if (root == null || root.getVisibility() != View.VISIBLE) { return; } Loading @@ -4659,7 +4659,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, final int viewCount = foundViews.size(); for (int i = 0; i < viewCount; i++) { View foundView = foundViews.get(i); if (foundView.isShown()) { if (foundView.getVisibility() == View.VISIBLE) { infos.add(foundView.createAccessibilityNodeInfo()); } } Loading Loading @@ -4732,7 +4732,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionFocus(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } // Get out of touch mode since accessibility wants to move focus around. Loading @@ -4742,7 +4742,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionClearFocus(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (!target.isFocused()) { Loading @@ -4754,7 +4754,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionSelect(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (target.isSelected()) { Loading @@ -4766,7 +4766,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionClearSelection(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (!target.isSelected()) { Loading @@ -4783,18 +4783,21 @@ public final class ViewRootImpl extends Handler implements ViewParent, } mFindByAccessibilityIdPredicate.init(accessibilityId); View foundView = root.findViewByPredicate(mFindByAccessibilityIdPredicate); return (foundView != null && foundView.isShown()) ? foundView : null; if (foundView == null || foundView.getVisibility() != View.VISIBLE) { return null; } return foundView; } private final class FindByAccessibilitytIdPredicate implements Predicate<View> { public int mSerchedId; public int mSearchedId; public void init(int searchedId) { mSerchedId = searchedId; mSearchedId = searchedId; } public boolean apply(View view) { return (view.getAccessibilityViewId() == mSerchedId); return (view.getAccessibilityViewId() == mSearchedId); } } } Loading core/java/android/widget/AdapterView.java +6 −7 Original line number Diff line number Diff line Loading @@ -886,9 +886,11 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED); } View selectedView = getSelectedView(); if (selectedView != null && selectedView.getVisibility() == VISIBLE) { // We first get a chance to populate the event. onPopulateAccessibilityEvent(event); } return false; } Loading @@ -896,10 +898,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { public void onPopulateAccessibilityEvent(AccessibilityEvent event) { // We send selection events only from AdapterView to avoid // generation of such event for each child. View selectedView = getSelectedView(); if (selectedView != null) { selectedView.dispatchPopulateAccessibilityEvent(event); } getSelectedView().dispatchPopulateAccessibilityEvent(event); } @Override Loading core/java/android/widget/RelativeLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -961,7 +961,8 @@ public class RelativeLayout extends ViewGroup { } for (View view : mTopToBottomLeftToRightSet) { if (view.dispatchPopulateAccessibilityEvent(event)) { if (view.getVisibility() == View.VISIBLE && view.dispatchPopulateAccessibilityEvent(event)) { mTopToBottomLeftToRightSet.clear(); return true; } Loading core/java/android/widget/TabWidget.java +4 −1 Original line number Diff line number Diff line Loading @@ -405,7 +405,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { onPopulateAccessibilityEvent(event); // Dispatch only to the selected tab. if (mSelectedTab != -1) { return getChildTabViewAt(mSelectedTab).dispatchPopulateAccessibilityEvent(event); View tabView = getChildTabViewAt(mSelectedTab); if (tabView != null && tabView.getVisibility() == VISIBLE) { return tabView.dispatchPopulateAccessibilityEvent(event); } } return false; } Loading Loading
core/java/android/view/ViewRootImpl.java +16 −13 Original line number Diff line number Diff line Loading @@ -4543,7 +4543,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, predicate.init(accessibilityId); View root = ViewRootImpl.this.mView; View target = root.findViewByPredicate(predicate); if (target != null && target.isShown()) { if (target != null && target.getVisibility() == View.VISIBLE) { info = target.createAccessibilityNodeInfo(); } } finally { Loading Loading @@ -4586,7 +4586,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, try { View root = ViewRootImpl.this.mView; View target = root.findViewById(viewId); if (target != null && target.isShown()) { if (target != null && target.getVisibility() == View.VISIBLE) { info = target.createAccessibilityNodeInfo(); } } finally { Loading Loading @@ -4637,14 +4637,14 @@ public final class ViewRootImpl extends Handler implements ViewParent, ArrayList<View> foundViews = mAttachInfo.mFocusablesTempList; foundViews.clear(); View root; View root = null; if (accessibilityViewId != View.NO_ID) { root = findViewByAccessibilityId(accessibilityViewId); } else { root = ViewRootImpl.this.mView; } if (root == null || !root.isShown()) { if (root == null || root.getVisibility() != View.VISIBLE) { return; } Loading @@ -4659,7 +4659,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, final int viewCount = foundViews.size(); for (int i = 0; i < viewCount; i++) { View foundView = foundViews.get(i); if (foundView.isShown()) { if (foundView.getVisibility() == View.VISIBLE) { infos.add(foundView.createAccessibilityNodeInfo()); } } Loading Loading @@ -4732,7 +4732,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionFocus(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } // Get out of touch mode since accessibility wants to move focus around. Loading @@ -4742,7 +4742,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionClearFocus(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (!target.isFocused()) { Loading @@ -4754,7 +4754,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionSelect(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (target.isSelected()) { Loading @@ -4766,7 +4766,7 @@ public final class ViewRootImpl extends Handler implements ViewParent, private boolean performActionClearSelection(int accessibilityId) { View target = findViewByAccessibilityId(accessibilityId); if (target == null) { if (target == null || target.getVisibility() != View.VISIBLE) { return false; } if (!target.isSelected()) { Loading @@ -4783,18 +4783,21 @@ public final class ViewRootImpl extends Handler implements ViewParent, } mFindByAccessibilityIdPredicate.init(accessibilityId); View foundView = root.findViewByPredicate(mFindByAccessibilityIdPredicate); return (foundView != null && foundView.isShown()) ? foundView : null; if (foundView == null || foundView.getVisibility() != View.VISIBLE) { return null; } return foundView; } private final class FindByAccessibilitytIdPredicate implements Predicate<View> { public int mSerchedId; public int mSearchedId; public void init(int searchedId) { mSerchedId = searchedId; mSearchedId = searchedId; } public boolean apply(View view) { return (view.getAccessibilityViewId() == mSerchedId); return (view.getAccessibilityViewId() == mSearchedId); } } } Loading
core/java/android/widget/AdapterView.java +6 −7 Original line number Diff line number Diff line Loading @@ -886,9 +886,11 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED); } View selectedView = getSelectedView(); if (selectedView != null && selectedView.getVisibility() == VISIBLE) { // We first get a chance to populate the event. onPopulateAccessibilityEvent(event); } return false; } Loading @@ -896,10 +898,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { public void onPopulateAccessibilityEvent(AccessibilityEvent event) { // We send selection events only from AdapterView to avoid // generation of such event for each child. View selectedView = getSelectedView(); if (selectedView != null) { selectedView.dispatchPopulateAccessibilityEvent(event); } getSelectedView().dispatchPopulateAccessibilityEvent(event); } @Override Loading
core/java/android/widget/RelativeLayout.java +2 −1 Original line number Diff line number Diff line Loading @@ -961,7 +961,8 @@ public class RelativeLayout extends ViewGroup { } for (View view : mTopToBottomLeftToRightSet) { if (view.dispatchPopulateAccessibilityEvent(event)) { if (view.getVisibility() == View.VISIBLE && view.dispatchPopulateAccessibilityEvent(event)) { mTopToBottomLeftToRightSet.clear(); return true; } Loading
core/java/android/widget/TabWidget.java +4 −1 Original line number Diff line number Diff line Loading @@ -405,7 +405,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { onPopulateAccessibilityEvent(event); // Dispatch only to the selected tab. if (mSelectedTab != -1) { return getChildTabViewAt(mSelectedTab).dispatchPopulateAccessibilityEvent(event); View tabView = getChildTabViewAt(mSelectedTab); if (tabView != null && tabView.getVisibility() == VISIBLE) { return tabView.dispatchPopulateAccessibilityEvent(event); } } return false; } Loading