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

Commit ab60f20f authored by Ameer Armaly's avatar Ameer Armaly
Browse files

Add flag for accessibility services to request that double tap gestures be...

Add flag for accessibility services to request that double tap gestures be dispatched to the service.

When disabled, double tap and double tap and hold will be handled by the framework. Specifically, they will perform ACTION_CLICK and ACTION_LONG_CLICK on the item with accessibility focus.

Bug: 136131815
Test:  atest GestureManifoldTest TouchExplorerTest  AccessibilityGestureDetectorTest
Change-Id: I19f8f2650e383f136ae9f4d0423d86721c27265b
parent 6e74001d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2873,6 +2873,8 @@ package android.accessibilityservice {
    method public final boolean performGlobalAction(int);
    method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo);
    method public boolean takeScreenshot(int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.graphics.Bitmap>);
    field public static final int GESTURE_DOUBLE_TAP = 17; // 0x11
    field public static final int GESTURE_DOUBLE_TAP_AND_HOLD = 18; // 0x12
    field public static final int GESTURE_SWIPE_DOWN = 2; // 0x2
    field public static final int GESTURE_SWIPE_DOWN_AND_LEFT = 15; // 0xf
    field public static final int GESTURE_SWIPE_DOWN_AND_RIGHT = 16; // 0x10
@@ -2989,6 +2991,7 @@ package android.accessibilityservice {
    field public static final int FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK = 1024; // 0x400
    field public static final int FLAG_REQUEST_TOUCH_EXPLORATION_MODE = 4; // 0x4
    field public static final int FLAG_RETRIEVE_INTERACTIVE_WINDOWS = 64; // 0x40
    field public static final int FLAG_SERVICE_HANDLES_DOUBLE_TAP = 2048; // 0x800
    field public int eventTypes;
    field public int feedbackType;
    field public int flags;
+0 −2
Original line number Diff line number Diff line
@@ -310,13 +310,11 @@ public abstract class AccessibilityService extends Service {

    /**
     * The user has performed a double tap gesture on the touch screen.
     * @hide
     */
    public static final int GESTURE_DOUBLE_TAP = 17;

    /**
     * The user has performed a double tap and hold gesture on the touch screen.
     * @hide
     */
    public static final int GESTURE_DOUBLE_TAP_AND_HOLD = 18;

+12 −0
Original line number Diff line number Diff line
@@ -341,6 +341,16 @@ public class AccessibilityServiceInfo implements Parcelable {
     */
    public static final int FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK = 0x00000400;

    /**
     * This flag requests that when {@link #FLAG_REQUEST_TOUCH_EXPLORATION_MODE} is enabled,
     * double tap and double tap and hold gestures are dispatched to the service rather than being
     * handled by the framework. If {@link #FLAG_REQUEST_TOUCH_EXPLORATION_MODE} is disabled this
     * flag has no effect.
     *
     * @see #FLAG_REQUEST_TOUCH_EXPLORATION_MODE
     */
    public static final int FLAG_SERVICE_HANDLES_DOUBLE_TAP = 0x0000800;

    /** {@hide} */
    public static final int FLAG_FORCE_DIRECT_BOOT_AWARE = 0x00010000;

@@ -1221,6 +1231,8 @@ public class AccessibilityServiceInfo implements Parcelable {
                return "FLAG_INCLUDE_NOT_IMPORTANT_VIEWS";
            case FLAG_REQUEST_TOUCH_EXPLORATION_MODE:
                return "FLAG_REQUEST_TOUCH_EXPLORATION_MODE";
            case FLAG_SERVICE_HANDLES_DOUBLE_TAP:
                return "FLAG_SERVICE_HANDLES_DOUBLE_TAP";
            case FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY:
                return "FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY";
            case FLAG_REPORT_VIEW_IDS:
+3 −0
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ public final class AccessibilityManager {
    /** @hide */
    public static final int STATE_FLAG_HIGH_TEXT_CONTRAST_ENABLED = 0x00000004;

    /** @hide */
    public static final int STATE_FLAG_DISPATCH_DOUBLE_TAP = 0x00000008;

    /** @hide */
    public static final int DALTONIZER_DISABLED = -1;

+2 −0
Original line number Diff line number Diff line
@@ -3714,6 +3714,8 @@
            <flag name="flagRequestFingerprintGestures" value="0x00000200" />
            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK}. -->
            <flag name="flagRequestShortcutWarningDialogSpokenFeedback" value="0x00000400" />
            <!-- Has flag {@link android.accessibilityservice.AccessibilityServiceInfo#FLAG_SERVICE_HANDLES_DOUBLE_TAP}. -->
            <flag name="flagServiceHandlesDoubleTap" value="0x00000800" />
        </attr>
        <!-- Component name of an activity that allows the user to modify
             the settings for this service. This setting cannot be changed at runtime. -->
Loading