From 45a02e0809c14a52aa24658666df0d41ce661857 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Sun, 17 Jun 2012 15:07:29 -0700 Subject: 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 --- core/java/android/view/View.java | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 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 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); } } } -- cgit v1.2.3