summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-02-06 21:51:11 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-06 21:51:11 +0000
commit41daba0052f4a9146aad4977da9eccf3c72450ce (patch)
treef724b9e8536325e3fda3bffc95ba589707c83b38 /core/java/android/view
parenta08934cf54e3120d5019839a4b6d553b3364e8d1 (diff)
parent060bca7444b8bf34fa95a6a71daf72fa8a85d78e (diff)
downloadframeworks_base-41daba0052f4a9146aad4977da9eccf3c72450ce.zip
frameworks_base-41daba0052f4a9146aad4977da9eccf3c72450ce.tar.gz
frameworks_base-41daba0052f4a9146aad4977da9eccf3c72450ce.tar.bz2
am 060bca74: Merge "Accessibility: Handle a missed case when clicking focused views." into lmp-mr1-dev
* commit '060bca7444b8bf34fa95a6a71daf72fa8a85d78e': Accessibility: Handle a missed case when clicking focused views.
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/View.java8
-rw-r--r--core/java/android/view/ViewGroup.java6
2 files changed, 12 insertions, 2 deletions
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.
*
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index fd50c4d..792b75b 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();