summaryrefslogtreecommitdiff
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-06-17 15:07:29 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-06-17 15:07:38 -0700
commit45a02e0809c14a52aa24658666df0d41ce661857 (patch)
tree331cad95192d9753a517d2a15b61b0436d554b39 /core/java/android/view/View.java
parent130b4572d1f3df702e5b296a655d15a41f6d4c66 (diff)
API for finding accessibility focus in virtual tree not needed.
1. The function for finding where the accessibility focus in a virtual node tree presented by an AccessibilityNodeProvider is not needed API since the framework already keeps track of the accessibility focused virtual node in order to draw the focus rectangle. This API adds unnecessary complexity to developers of AccessibilityNodeProviders. bug:6675330 Change-Id: I84774686b06a995073a39e45b8ef22f2cd04b773
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java31
1 files changed, 3 insertions, 28 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index db3ba405c271..b1caa2f4519b 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4558,31 +4558,6 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
if ((event.getEventType() & POPULATING_ACCESSIBILITY_EVENT_TYPES) != 0) {
dispatchPopulateAccessibilityEvent(event);
}
- // Intercept accessibility focus events fired by virtual nodes to keep
- // track of accessibility focus position in such nodes.
- final int eventType = event.getEventType();
- switch (eventType) {
- case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED: {
- final long virtualNodeId = AccessibilityNodeInfo.getVirtualDescendantId(
- event.getSourceNodeId());
- if (virtualNodeId != AccessibilityNodeInfo.UNDEFINED) {
- ViewRootImpl viewRootImpl = getViewRootImpl();
- if (viewRootImpl != null) {
- viewRootImpl.setAccessibilityFocusedHost(this);
- }
- }
- } break;
- case AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: {
- final long virtualNodeId = AccessibilityNodeInfo.getVirtualDescendantId(
- event.getSourceNodeId());
- if (virtualNodeId != AccessibilityNodeInfo.UNDEFINED) {
- ViewRootImpl viewRootImpl = getViewRootImpl();
- if (viewRootImpl != null) {
- viewRootImpl.setAccessibilityFocusedHost(null);
- }
- }
- } break;
- }
// In the beginning we called #isShown(), so we know that getParent() is not null.
getParent().requestSendAccessibilityEvent(this, event);
}
@@ -6311,7 +6286,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
mPrivateFlags2 |= ACCESSIBILITY_FOCUSED;
ViewRootImpl viewRootImpl = getViewRootImpl();
if (viewRootImpl != null) {
- viewRootImpl.setAccessibilityFocusedHost(this);
+ viewRootImpl.setAccessibilityFocus(this, null);
}
invalidate();
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED);
@@ -6342,7 +6317,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
if (viewRootImpl != null) {
View focusHost = viewRootImpl.getAccessibilityFocusedHost();
if (focusHost != null && ViewRootImpl.isViewDescendantOf(focusHost, this)) {
- viewRootImpl.setAccessibilityFocusedHost(null);
+ viewRootImpl.setAccessibilityFocus(null, null);
}
}
}
@@ -7953,7 +7928,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
// If the window does not have input focus we take away accessibility
// focus as soon as the user stop hovering over the view.
if (mAttachInfo != null && !mAttachInfo.mHasWindowFocus) {
- getViewRootImpl().setAccessibilityFocusedHost(null);
+ getViewRootImpl().setAccessibilityFocus(null, null);
}
}
}