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

Commit e7fad2fa authored by Svet Ganov's avatar Svet Ganov Committed by android-build-merger
Browse files

am 763ce6c0: am 41daba00: am 060bca74: Merge "Accessibility: Handle a missed...

am 763ce6c0: am 41daba00: am 060bca74: Merge "Accessibility: Handle a missed case when clicking focused views." into lmp-mr1-dev
automerge: 033c2a21

* commit '033c2a21':
  Accessibility: Handle a missed case when clicking focused views.
parents 3e2e16b6 033c2a21
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -8444,8 +8444,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.
@@ -8494,6 +8493,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.
     *
+6 −0
Original line number Diff line number Diff line
@@ -1936,6 +1936,12 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        // Whether this event should be handled by the accessibility focus first.
        final boolean targetAccessibilityFocus = ev.isTargetAccessibilityFocus();

        // If the event targets the accessibility focused view and this is it, start
        // normal event dispatch. Maybe a descendant is what will handle the click.
        if (targetAccessibilityFocus && isAccessibilityFocusedViewOrHost()) {
            ev.setTargetAccessibilityFocus(false);
        }

        boolean handled = false;
        if (onFilterTouchEventForSecurity(ev)) {
            final int action = ev.getAction();