diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-07-02 18:12:00 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-07-02 18:21:31 -0700 |
| commit | 27e2da7c171afa39358bbead18fbe3e6b8ea6637 (patch) | |
| tree | a506f123a83de24081650f819db65b2b5e3f92cb /core/java/android/view/ViewGroup.java | |
| parent | 0a6101b2adaae2128e4cad8247f827c164b8d657 (diff) | |
Remove the accessibility focus search code.
1. In JellyBean we have added some APIs to search for next accessibility
focus in various directions and set accessibility focus from hover.
However, we have decided that there is not clean answer for how this
should behave and the APIs were hidden. Now the accessibility service
is responsible for that. The unused code is now taken out.
2. This patch also takes out the hidden attribute accessibiligyFocusable
since we moved the responsibility for implementing focus search strategy
to accessibility services and we did not need that for Jellybean which
is a good sign that this is not needed. I general this is one less thing
for an app developer to worry about. We can add this if needed later.
bug:6773816
Change-Id: I0c858d72c93a2b7ff1f8f35a08d33ec4b9eb85fd
Diffstat (limited to 'core/java/android/view/ViewGroup.java')
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index f66c4dedda8b..102b504ce394 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -624,11 +624,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager * FOCUS_RIGHT, or 0 for not applicable. */ public View focusSearch(View focused, int direction) { - // If we are moving accessibility focus we want to consider all - // views no matter if they are on the screen. It is responsibility - // of the accessibility service to check whether the result is in - // the screen. - if (isRootNamespace() && (direction & FOCUS_ACCESSIBILITY) == 0) { + if (isRootNamespace()) { // root namespace means we should consider ourselves the top of the // tree for focus searching; otherwise we could be focus searching // into other tabs. see LocalActivityManager and TabHost for more info @@ -863,8 +859,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager final int descendantFocusability = getDescendantFocusability(); - if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS - || (focusableMode & FOCUSABLES_ACCESSIBILITY) == FOCUSABLES_ACCESSIBILITY) { + if (descendantFocusability != FOCUS_BLOCK_DESCENDANTS) { final int count = mChildrenCount; final View[] children = mChildren; @@ -882,9 +877,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // among the focusable children would be more interesting. if (descendantFocusability != FOCUS_AFTER_DESCENDANTS // No focusable descendants - || (focusableCount == views.size()) - // We are collecting accessibility focusables. - || (focusableMode & FOCUSABLES_ACCESSIBILITY) == FOCUSABLES_ACCESSIBILITY) { + || (focusableCount == views.size())) { super.addFocusables(views, direction, focusableMode); } } @@ -1654,20 +1647,6 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } /** - * @hide - */ - @Override - public View findViewToTakeAccessibilityFocusFromHover(View child, View descendant) { - if (includeForAccessibility() && isActionableForAccessibility()) { - return this; - } - if (mParent != null) { - return mParent.findViewToTakeAccessibilityFocusFromHover(this, descendant); - } - return null; - } - - /** * Implement this method to intercept hover events before they are handled * by child views. * <p> |
