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

Commit 62ea99ca authored by Rhed Jao's avatar Rhed Jao
Browse files

Accessibility shortcut improvement (2/n)

New accessibility flag for accessibility shortcut.

Bug: 136293963
Test: atest AccessibilityServiceInfoTest
Change-Id: Ic545c551f148ef240a80fabc6af1d3587a93923b
parent d59d8add
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2946,6 +2946,7 @@ package android.accessibilityservice {
    field public static final int FEEDBACK_SPOKEN = 1; // 0x1
    field public static final int FEEDBACK_VISUAL = 8; // 0x8
    field public static final int FLAG_ENABLE_ACCESSIBILITY_VOLUME = 128; // 0x80
    field public static final int FLAG_HANDLE_SHORTCUT = 2048; // 0x800
    field public static final int FLAG_INCLUDE_NOT_IMPORTANT_VIEWS = 2; // 0x2
    field public static final int FLAG_REPORT_VIEW_IDS = 16; // 0x10
    field public static final int FLAG_REQUEST_ACCESSIBILITY_BUTTON = 256; // 0x100
+12 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.accessibilityservice;

import static android.content.pm.PackageManager.FEATURE_FINGERPRINT;

import android.accessibilityservice.AccessibilityButtonController.AccessibilityButtonCallback;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.UnsupportedAppUsage;
@@ -322,6 +323,14 @@ public class AccessibilityServiceInfo implements Parcelable {
     */
    public static final int FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK = 0x00000400;

    /**
     * This flag indicates that the accessibility service will handle the shortcut action itself.
     * A callback {@link AccessibilityButtonCallback#onClicked(AccessibilityButtonController)} is
     * called when the user presses the accessibility shortcut. Otherwise, the service is enabled
     * or disabled by the system instead.
     */
    public static final int FLAG_HANDLE_SHORTCUT = 0x00000800;

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

@@ -423,6 +432,7 @@ public class AccessibilityServiceInfo implements Parcelable {
     * @see #FLAG_ENABLE_ACCESSIBILITY_VOLUME
     * @see #FLAG_REQUEST_ACCESSIBILITY_BUTTON
     * @see #FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK
     * @see #FLAG_HANDLE_SHORTCUT
     */
    public int flags;

@@ -1103,6 +1113,8 @@ public class AccessibilityServiceInfo implements Parcelable {
                return "FLAG_REQUEST_FINGERPRINT_GESTURES";
            case FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK:
                return "FLAG_REQUEST_SHORTCUT_WARNING_DIALOG_SPOKEN_FEEDBACK";
            case FLAG_HANDLE_SHORTCUT:
                return "FLAG_HANDLE_SHORTCUT";
            default:
                return null;
        }
+2 −0
Original line number Diff line number Diff line
@@ -3701,6 +3701,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_HANDLE_SHORTCUT}. -->
            <flag name="flagHandleShortcut" 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. -->