Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07b726c8 authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Enabling accessibility focus only if explore by touch is on.

1. Now we will enable the accessibility focus only if Explore by
   Touch is enabled. Enabling this feature allows a blind user to
   touch the screen and set the accessibility focus at this
   location as well as get spoken feedback. Also an accessibility
   service can move the accessibility as a result of user gestures
   detected only if Explore by Touch is enabled. Since we will
   handle some gestures by default if not accessibility service
   does so to provide reasonable built-in navigation of the UI
   by "objects" we need the accessibility focus functionality.

bug:6383361

Change-Id: I13ce6072a90f5838c7656379788144c99a772bf0
parent 427db9b3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5942,7 +5942,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
     * @hide
     */
    public boolean requestAccessibilityFocus() {
        if (!AccessibilityManager.getInstance(mContext).isEnabled()) {
        AccessibilityManager manager = AccessibilityManager.getInstance(mContext);
        if (!manager.isEnabled() || !manager.isTouchExplorationEnabled()) {
            return false;
        }
        if ((mViewFlags & VISIBILITY_MASK) != VISIBLE) {
+2 −1
Original line number Diff line number Diff line
@@ -2316,7 +2316,8 @@ public final class ViewRootImpl implements ViewParent,
     * @param canvas The canvas on which to draw.
     */
    private void drawAccessibilityFocusedDrawableIfNeeded(Canvas canvas) {
        if (!AccessibilityManager.getInstance(mView.mContext).isEnabled()) {
        AccessibilityManager manager = AccessibilityManager.getInstance(mView.mContext);
        if (!manager.isEnabled() || !manager.isTouchExplorationEnabled()) {
            return;
        }
        if (mAccessibilityFocusedHost == null || mAccessibilityFocusedHost.mAttachInfo == null) {