Loading core/java/android/hardware/input/input_framework.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -92,10 +92,17 @@ flag { bug: "383730505" } flag { name: "enable_select_to_speak_key_gestures" namespace: "accessibility" description: "Adds key gestures for select to speak" bug: "375277034" } flag { name: "enable_talkback_and_magnifier_key_gestures" namespace: "input" description: "Adds key gestures for talkback and magnifier" description: "Adds key gestures for TalkBack and Magnification" bug: "375277034" } Loading packages/SystemUI/src/com/android/systemui/accessibility/keygesture/ui/KeyGestureDialogStartable.kt +3 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,9 @@ constructor( override fun start() { if ( !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableVoiceAccessKeyGestures() !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableVoiceAccessKeyGestures() ) { return } Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/AccessibilityShortcutsSource.kt +4 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.view.KeyEvent.META_ALT_ON import android.view.KeyEvent.META_META_ON import android.view.KeyboardShortcutGroup import android.view.KeyboardShortcutInfo import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.keyboardA11yShortcutControl Loading Loading @@ -110,6 +111,9 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc command(META_META_ON or META_ALT_ON, KEYCODE_M) } ) } if (enableSelectToSpeakKeyGestures()) { shortcuts.add( // Activate Select to Speak: // - Meta + Alt + S Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +14 −6 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import static android.view.Display.INVALID_DISPLAY; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import static android.view.accessibility.AccessibilityManager.FlashNotificationReason; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; Loading Loading @@ -667,10 +668,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mAccessibilityContentObserver.register(mContext.getContentResolver()); List<Integer> supportedGestures = new ArrayList<>(); if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); if (enableSelectToSpeakKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); } if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); } if (enableVoiceAccessKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); Loading Loading @@ -4483,13 +4486,18 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub if (shortcutType == UserShortcutType.KEY_GESTURE) { if(!enableTalkbackAndMagnifierKeyGestures() && (shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME) || shortcutTargets.contains(mContext.getString( R.string.config_defaultSelectToSpeakService)) || shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService)))) { Slog.w(LOG_TAG, "KEY_GESTURE type magnification, select to speak and TalkBack shortcuts" + "are disabled by feature flag"); "KEY_GESTURE type magnification and TalkBack shortcuts are disabled by " + "feature flag"); return; } if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultSelectToSpeakService))) { Slog.w(LOG_TAG, "KEY_GESTURE type select to speak shortcuts are disabled by feature " + "flag"); return; } if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( Loading services/core/java/com/android/server/input/InputGestureManager.java +9 −6 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.hardware.input.InputGestureData.createKeyTrigger; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; Loading Loading @@ -210,6 +211,14 @@ final class InputGestureManager { /* allowCaptureByFocusedWindow = */false )); } if (enableSelectToSpeakKeyGestures()) { systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_S, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK, /* allowCaptureByFocusedWindow = */true )); } if (enableTalkbackAndMagnifierKeyGestures()) { systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_T, Loading @@ -223,12 +232,6 @@ final class InputGestureManager { KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, /* allowCaptureByFocusedWindow = */true )); systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_S, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK, /* allowCaptureByFocusedWindow = */true )); } if (enableVoiceAccessKeyGestures()) { systemShortcuts.add( Loading Loading
core/java/android/hardware/input/input_framework.aconfig +8 −1 Original line number Diff line number Diff line Loading @@ -92,10 +92,17 @@ flag { bug: "383730505" } flag { name: "enable_select_to_speak_key_gestures" namespace: "accessibility" description: "Adds key gestures for select to speak" bug: "375277034" } flag { name: "enable_talkback_and_magnifier_key_gestures" namespace: "input" description: "Adds key gestures for talkback and magnifier" description: "Adds key gestures for TalkBack and Magnification" bug: "375277034" } Loading
packages/SystemUI/src/com/android/systemui/accessibility/keygesture/ui/KeyGestureDialogStartable.kt +3 −1 Original line number Diff line number Diff line Loading @@ -64,7 +64,9 @@ constructor( override fun start() { if ( !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableVoiceAccessKeyGestures() !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableVoiceAccessKeyGestures() ) { return } Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/AccessibilityShortcutsSource.kt +4 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.view.KeyEvent.META_ALT_ON import android.view.KeyEvent.META_META_ON import android.view.KeyboardShortcutGroup import android.view.KeyboardShortcutInfo import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.keyboardA11yShortcutControl Loading Loading @@ -110,6 +111,9 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc command(META_META_ON or META_ALT_ON, KEYCODE_M) } ) } if (enableSelectToSpeakKeyGestures()) { shortcuts.add( // Activate Select to Speak: // - Meta + Alt + S Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +14 −6 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ import static android.view.Display.INVALID_DISPLAY; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import static android.view.accessibility.AccessibilityManager.FlashNotificationReason; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; Loading Loading @@ -667,10 +668,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub mAccessibilityContentObserver.register(mContext.getContentResolver()); List<Integer> supportedGestures = new ArrayList<>(); if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); if (enableSelectToSpeakKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); } if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); } if (enableVoiceAccessKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); Loading Loading @@ -4483,13 +4486,18 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub if (shortcutType == UserShortcutType.KEY_GESTURE) { if(!enableTalkbackAndMagnifierKeyGestures() && (shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME) || shortcutTargets.contains(mContext.getString( R.string.config_defaultSelectToSpeakService)) || shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService)))) { Slog.w(LOG_TAG, "KEY_GESTURE type magnification, select to speak and TalkBack shortcuts" + "are disabled by feature flag"); "KEY_GESTURE type magnification and TalkBack shortcuts are disabled by " + "feature flag"); return; } if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultSelectToSpeakService))) { Slog.w(LOG_TAG, "KEY_GESTURE type select to speak shortcuts are disabled by feature " + "flag"); return; } if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( Loading
services/core/java/com/android/server/input/InputGestureManager.java +9 −6 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.hardware.input.InputGestureData.createKeyTrigger; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; Loading Loading @@ -210,6 +211,14 @@ final class InputGestureManager { /* allowCaptureByFocusedWindow = */false )); } if (enableSelectToSpeakKeyGestures()) { systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_S, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK, /* allowCaptureByFocusedWindow = */true )); } if (enableTalkbackAndMagnifierKeyGestures()) { systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_T, Loading @@ -223,12 +232,6 @@ final class InputGestureManager { KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, /* allowCaptureByFocusedWindow = */true )); systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_S, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK, /* allowCaptureByFocusedWindow = */true )); } if (enableVoiceAccessKeyGestures()) { systemShortcuts.add( Loading