diff options
| author | Svet Ganov <svetoslavganov@google.com> | 2015-02-07 00:10:59 +0000 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-07 00:10:59 +0000 |
| commit | 033c2a21f857948416eeaa36e6a613743b548eff (patch) | |
| tree | 6e2a75f8dd95d88bf8a93a63e3f87987e4e9b5c9 /core/java | |
| parent | 35dd319e4a652518ab8b89012e5a8cf73a82090d (diff) | |
| parent | 763ce6c0c48416a67a36919d1b7ac67d6b73c430 (diff) | |
am 763ce6c0: am 41daba00: am 060bca74: Merge "Accessibility: Handle a missed case when clicking focused views." into lmp-mr1-dev
* commit '763ce6c0c48416a67a36919d1b7ac67d6b73c430':
Accessibility: Handle a missed case when clicking focused views.
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/view/View.java | 8 | ||||
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index e4a8978e3fef..3c058729880a 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. * diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 719e780909f6..c4b5bbcf2f38 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -1934,6 +1934,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // Whether this event should be handled by the accessibility focus first. final boolean targetAccessibilityFocus = ev.isTargetAccessibilityFocus(); + // If the event targets the accessibility focused view and this is it, start + // normal event dispatch. Maybe a descendant is what will handle the click. + if (targetAccessibilityFocus && isAccessibilityFocusedViewOrHost()) { + ev.setTargetAccessibilityFocus(false); + } + boolean handled = false; if (onFilterTouchEventForSecurity(ev)) { final int action = ev.getAction(); |
