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

Commit 3c71e504 authored by Ryan Lin's avatar Ryan Lin Committed by Android (Google) Code Review
Browse files

Merge "Added ACTION_PRESS_AND_HOLD"

parents 8916837d 7b122e8f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1865,6 +1865,7 @@ package android {
    field public static final int accessibilityActionPageLeft = 16908360; // 0x1020048
    field public static final int accessibilityActionPageRight = 16908361; // 0x1020049
    field public static final int accessibilityActionPageUp = 16908358; // 0x1020046
    field public static final int accessibilityActionPressAndHold = 16908362; // 0x102004a
    field public static final int accessibilityActionScrollDown = 16908346; // 0x102003a
    field public static final int accessibilityActionScrollLeft = 16908345; // 0x1020039
    field public static final int accessibilityActionScrollRight = 16908347; // 0x102003b
@@ -52817,6 +52818,7 @@ package android.view.accessibility {
    field public static final String ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT = "ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT";
    field public static final String ACTION_ARGUMENT_MOVE_WINDOW_X = "ACTION_ARGUMENT_MOVE_WINDOW_X";
    field public static final String ACTION_ARGUMENT_MOVE_WINDOW_Y = "ACTION_ARGUMENT_MOVE_WINDOW_Y";
    field public static final String ACTION_ARGUMENT_PRESS_HOLD_DURATION_MILLIS_INT = "android.view.accessibility.action.ARGUMENT_PRESS_HOLD_DURATION_MILLIS_INT";
    field public static final String ACTION_ARGUMENT_PROGRESS_VALUE = "android.view.accessibility.action.ARGUMENT_PROGRESS_VALUE";
    field public static final String ACTION_ARGUMENT_ROW_INT = "android.view.accessibility.action.ARGUMENT_ROW_INT";
    field public static final String ACTION_ARGUMENT_SELECTION_END_INT = "ACTION_ARGUMENT_SELECTION_END_INT";
@@ -52884,6 +52886,7 @@ package android.view.accessibility {
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PAGE_RIGHT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PAGE_UP;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PASTE;
    field @NonNull public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PRESS_AND_HOLD;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_PREVIOUS_HTML_ELEMENT;
    field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SCROLL_BACKWARD;
+41 −0
Original line number Diff line number Diff line
@@ -529,6 +529,20 @@ public class AccessibilityNodeInfo implements Parcelable {
    public static final String ACTION_ARGUMENT_ACCESSIBLE_CLICKABLE_SPAN =
            "android.view.accessibility.action.ACTION_ARGUMENT_ACCESSIBLE_CLICKABLE_SPAN";

    /**
     * Argument to represent the duration in milliseconds to press and hold a node.
     * <p>
     * <strong>Type:</strong> int<br>
     * <strong>Actions:</strong>
     * <ul>
     *     <li>{@link AccessibilityAction#ACTION_PRESS_AND_HOLD}</li>
     * </ul>
     *
     * @see AccessibilityAction#ACTION_PRESS_AND_HOLD
     */
    public static final String ACTION_ARGUMENT_PRESS_HOLD_DURATION_MILLIS_INT =
            "android.view.accessibility.action.ARGUMENT_PRESS_HOLD_DURATION_MILLIS_INT";

    // Focus types

    /**
@@ -4035,6 +4049,8 @@ public class AccessibilityNodeInfo implements Parcelable {
                return "ACTION_SHOW_TOOLTIP";
            case R.id.accessibilityActionHideTooltip:
                return "ACTION_HIDE_TOOLTIP";
            case R.id.accessibilityActionPressAndHold:
                return "ACTION_PRESS_AND_HOLD";
            default:
                return "ACTION_UNKNOWN";
        }
@@ -4626,6 +4642,31 @@ public class AccessibilityNodeInfo implements Parcelable {
        public static final AccessibilityAction ACTION_HIDE_TOOLTIP =
                new AccessibilityAction(R.id.accessibilityActionHideTooltip);

        /**
         * Action that presses and holds a node.
         * <p>
         * This action is for nodes that have distinct behavior that depends on how long a press is
         * held. Nodes having a single action for long press should use {@link #ACTION_LONG_CLICK}
         *  instead of this action, and nodes should not expose both actions.
         * <p>
         * Use {@link #ACTION_ARGUMENT_PRESS_HOLD_DURATION_MILLIS_INT} to specify how long the
         * node is pressed. To ensure reasonable behavior, the first value of this argument should
         * be 0 and the others should greater than 0 and less than 10,000. UIs requested to hold for
         * times outside of this range should ignore the action.
         * <p>
         * The total time the element is held could be specified by an accessibility user up-front,
         * or may depend on what happens on the UI as the user continues to request the hold.
         * <p>
         *   <strong>Note:</strong> The time between dispatching the action and it arriving in the
         *     UI process is not guaranteed. It is possible on a busy system for the time to expire
         *     unexpectedly. For the case of holding down a key for a repeating action, a delayed
         *     arrival should be benign. Please do not use this sort of action in cases where such
         *     delays will lead to unexpected UI behavior.
         * <p>
         */
        @NonNull public static final AccessibilityAction ACTION_PRESS_AND_HOLD =
                new AccessibilityAction(R.id.accessibilityActionPressAndHold);

        private final int mActionId;
        private final CharSequence mLabel;

+3 −0
Original line number Diff line number Diff line
@@ -220,4 +220,7 @@

  <!-- Accessibility action identifier for {@link android.accessibilityservice.AccessibilityService#GLOBAL_ACTION_TAKE_SCREENSHOT}. -->
  <item type="id" name="accessibilitySystemActionTakeScreenshot" />

  <!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_PRESS_AND_HOLD}. -->
  <item type="id" name="accessibilityActionPressAndHold" />
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -3013,6 +3013,7 @@
    </public-group>

    <public-group type="id" first-id="0x0102004a">
      <public name="accessibilityActionPressAndHold" />
    </public-group>

    <public-group type="string" first-id="0x01040025">