From 0a2cceebd5503329f7038847906351af21434048 Mon Sep 17 00:00:00 2001 From: Svet Ganov Date: Fri, 6 Feb 2015 10:12:32 -0800 Subject: Accessibility: Handle a missed case when clicking focused views. The clicking logic was missing the case where a child of the accessibility focused view reacts to the injected down up events for clicking. This results of a whole class of views being non-interactive. Now if an event is targeting accessibility focus and the dispatching view group has this focus, we clear the flag before dispatching to children, so they can handle the event rather ignoring it becuase they are not accessibility focused. bug:19252492 Change-Id: I6ac25bb7a50b35bb638ca4bfb9fc4198d08c2d4d --- core/java/android/view/View.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'core/java/android/view/View.java') diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e4a8978..3c05872 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -8440,8 +8440,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, // If the event should be handled by accessibility focus first. if (event.isTargetAccessibilityFocus()) { // We don't have focus or no virtual descendant has it, do not handle the event. - if (!isAccessibilityFocused() && !(getViewRootImpl() != null && getViewRootImpl() - .getAccessibilityFocusedHost() == this)) { + if (!isAccessibilityFocusedViewOrHost()) { return false; } // We have focus and got the event, then use normal event dispatch. @@ -8490,6 +8489,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, return result; } + boolean isAccessibilityFocusedViewOrHost() { + return isAccessibilityFocused() || (getViewRootImpl() != null && getViewRootImpl() + .getAccessibilityFocusedHost() == this); + } + /** * Filter the touch event to apply security policies. * -- cgit v1.1