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

Commit e9eb5b15 authored by Yuhan Yang's avatar Yuhan Yang Committed by Android (Google) Code Review
Browse files

Merge "Add autoclick to shortcut features map" into main

parents b9f45a26 a6374ea4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ public class AccessibilityShortcutController {
            new ComponentName("com.android.server.accessibility", "ReduceBrightColors");
    public static final ComponentName FONT_SIZE_COMPONENT_NAME =
            new ComponentName("com.android.server.accessibility", "FontSize");
    public static final ComponentName AUTOCLICK_COMPONENT_NAME =
            new ComponentName("com.android.server.accessibility", "Autoclick");

    // The component name for the sub setting of Accessibility button in Accessibility settings
    public static final ComponentName ACCESSIBILITY_BUTTON_COMPONENT_NAME =
@@ -163,7 +165,7 @@ public class AccessibilityShortcutController {
            getFrameworkShortcutFeaturesMap() {

        if (sFrameworkShortcutFeaturesMap == null) {
            Map<ComponentName, FrameworkFeatureInfo> featuresMap = new ArrayMap<>(4);
            Map<ComponentName, FrameworkFeatureInfo> featuresMap = new ArrayMap<>(8);
            featuresMap.put(COLOR_INVERSION_COMPONENT_NAME,
                    new ToggleableFrameworkFeatureInfo(
                            Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED,
@@ -174,6 +176,11 @@ public class AccessibilityShortcutController {
                            Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED,
                            "1" /* Value to enable */, "0" /* Value to disable */,
                            R.string.color_correction_feature_name));
            featuresMap.put(AUTOCLICK_COMPONENT_NAME,
                    new ToggleableFrameworkFeatureInfo(
                            Settings.Secure.ACCESSIBILITY_AUTOCLICK_ENABLED,
                            "1" /* Value to enable */, "0" /* Value to disable */,
                            R.string.autoclick_feature_name));
            if (SUPPORT_ONE_HANDED_MODE) {
                featuresMap.put(ONE_HANDED_COMPONENT_NAME,
                        new ToggleableFrameworkFeatureInfo(
+14 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.accessibility.dialog;

import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.AUTOCLICK_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.COLOR_INVERSION_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.DALTONIZER_COMPONENT_NAME;
import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_CONTROLLER_NAME;
@@ -214,6 +215,19 @@ public final class AccessibilityTargetHelper {
                        Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED);
        targets.add(colorInversion);

        // TODO(b/394683600): Update Icon with the autoclick asset.
        final ToggleAllowListingFeatureTarget autoclick =
                new ToggleAllowListingFeatureTarget(context,
                        shortcutType,
                        isShortcutContained(context, shortcutType,
                                AUTOCLICK_COMPONENT_NAME.flattenToString()),
                        AUTOCLICK_COMPONENT_NAME.flattenToString(),
                        uid,
                        context.getString(R.string.autoclick_feature_name),
                        context.getDrawable(R.drawable.ic_accessibility_generic),
                        Settings.Secure.ACCESSIBILITY_AUTOCLICK_ENABLED);
        targets.add(autoclick);

        if (SUPPORT_ONE_HANDED_MODE) {
            final ToggleAllowListingFeatureTarget oneHandedMode =
                    new ToggleAllowListingFeatureTarget(context,
+3 −0
Original line number Diff line number Diff line
@@ -5009,6 +5009,9 @@
    <!-- Title of hearing aids feature, shown in the warning dialog about the accessibility shortcut. [CHAR LIMIT=none] -->
    <string name="hearing_aids_feature_name">Hearing devices</string>
    <!-- Title of autoclick feature, shown in the warning dialog about the accessibility shortcut. [CHAR LIMIT=none] -->
    <string name="autoclick_feature_name">Autoclick</string>
    <!-- Text of hearing device disconnected state. [CHAR LIMIT=20] -->
    <string name="hearing_device_status_disconnected">Disconnected</string>
+1 −0
Original line number Diff line number Diff line
@@ -3791,6 +3791,7 @@
  <java-symbol type="string" name="accessibility_shortcut_disabling_service" />
  <java-symbol type="string" name="color_inversion_feature_name" />
  <java-symbol type="string" name="color_correction_feature_name" />
  <java-symbol type="string" name="autoclick_feature_name"/>
  <java-symbol type="string" name="reduce_bright_colors_feature_name" />
  <java-symbol type="string" name="config_defaultAccessibilityService" />
  <java-symbol type="string" name="config_defaultSelectToSpeakService" />