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

Commit 2ab28136 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "isFocusable should also check for clear focus."

parents 997dd181 2a53ad9e
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -8747,14 +8747,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        info.setContentDescription(getContentDescription());
        info.setEnabled(isEnabled());
        info.setClickable(isClickable());
        info.setFocusable(isFocusable());
        info.setScreenReaderFocusable(isScreenReaderFocusable());
        info.setFocused(isFocused());
        info.setAccessibilityFocused(isAccessibilityFocused());
        info.setSelected(isSelected());
        info.setLongClickable(isLongClickable());
        info.setContextClickable(isContextClickable());
        info.setLiveRegion(getAccessibilityLiveRegion());
        if ((mTooltipInfo != null) && (mTooltipInfo.mTooltipText != null)) {
            info.setTooltipText(mTooltipInfo.mTooltipText);
+8 −2
Original line number Diff line number Diff line
@@ -1159,7 +1159,13 @@ public class AccessibilityNodeInfo implements Parcelable {
    }

    private boolean hasActionWithId(int actionId) {
        return getActionList().stream().anyMatch(action -> action.getId() == actionId);
        List<AccessibilityAction> actions = getActionList();
        for (int i = 0; i < actions.size(); i++) {
            if (actions.get(i).getId() == actionId) {
                return true;
            }
        }
        return false;
    }

    /**
@@ -1761,7 +1767,7 @@ public class AccessibilityNodeInfo implements Parcelable {
     * @return True if the node is focusable.
     */
    public boolean isFocusable() {
        return hasActionWithId(ACTION_FOCUS);
        return hasActionWithId(ACTION_FOCUS) || hasActionWithId(ACTION_CLEAR_FOCUS);
    }

    /**