summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java8
1 files changed, 6 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.
*