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

Commit 9071cf5e authored by Riley Jones's avatar Riley Jones
Browse files

Revert "Refactoring AccessibilityManagerService Read & Restore"

This reverts commit 05b19d6d.

Reason for revert: Restore generates duplicates of the default shortcut

Change-Id: Iae3956ba35acaad6b9a484c304975e78be607fdb
parent 05b19d6d
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -180,26 +180,6 @@ public final class ShortcutUtils {
        }
    }

    /**
     * Converts {@link Settings.Secure} key to {@link UserShortcutType}.
     *
     * @param key The shortcut key.
     * @return Mapping type in Settings.
     */
    public static int convertToType(String key) {
        return switch (key) {
            case Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS -> UserShortcutType.SOFTWARE;
            case Settings.Secure.ACCESSIBILITY_QS_TARGETS -> UserShortcutType.QUICK_SETTINGS;
            case Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE -> UserShortcutType.HARDWARE;
            case Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED ->
                    UserShortcutType.TRIPLETAP;
            case Settings.Secure.ACCESSIBILITY_MAGNIFICATION_TWO_FINGER_TRIPLE_TAP_ENABLED ->
                    UserShortcutType.TWOFINGER_DOUBLETAP;
            default -> throw new IllegalArgumentException(
                    "Unsupported user shortcut key: " + key);
        };
    }

    /**
     * Updates an accessibility state if the accessibility service is a Always-On a11y service,
     * a.k.a. AccessibilityServices that has FLAG_REQUEST_ACCESSIBILITY_BUTTON
+167 −106

File changed.

Preview size limit exceeded, changes collapsed.

+13 −37

File changed.

Preview size limit exceeded, changes collapsed.

+6 −7

File changed.

Preview size limit exceeded, changes collapsed.

+3 −4

File changed.

Preview size limit exceeded, changes collapsed.