Loading core/java/android/hardware/input/input_framework.aconfig +8 −1 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,14 @@ flag { flag { flag { name: "enable_talkback_and_magnifier_key_gestures" name: "enable_talkback_and_magnifier_key_gestures" namespace: "input" namespace: "input" description: "Adds key gestures for TalkBack and Magnification" description: "Adds key gestures for Magnification. TalkBack key gesture has been flagged separately under enable_talkback_key_gestures." bug: "375277034" } flag { name: "enable_talkback_key_gestures" namespace: "accessibility" description: "Adds key gesture for TalkBack" bug: "375277034" bug: "375277034" } } Loading packages/SystemUI/src/com/android/systemui/accessibility/keygesture/ui/KeyGestureDialogStartable.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ constructor( if ( if ( !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableTalkbackKeyGestures() && !Flags.enableVoiceAccessKeyGestures() !Flags.enableVoiceAccessKeyGestures() ) { ) { return return Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/AccessibilityShortcutsSource.kt +5 −1 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.KeyboardShortcutGroup import android.view.KeyboardShortcutInfo import android.view.KeyboardShortcutInfo import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableTalkbackKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.keyboardA11yShortcutControl import com.android.hardware.input.Flags.keyboardA11yShortcutControl import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dagger.qualifiers.Main Loading Loading @@ -94,7 +95,7 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc ) ) } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackKeyGestures()) { shortcuts.add( shortcuts.add( // Toggle talkback: // Toggle talkback: // - Meta + Alt + T // - Meta + Alt + T Loading @@ -102,6 +103,9 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc command(META_META_ON or META_ALT_ON, KEYCODE_T) command(META_META_ON or META_ALT_ON, KEYCODE_T) } } ) ) } if (enableTalkbackAndMagnifierKeyGestures()) { shortcuts.add( shortcuts.add( // Toggle magnification: // Toggle magnification: // - Meta + Alt + M // - Meta + Alt + M Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +15 −7 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ import static android.view.accessibility.AccessibilityManager.FlashNotificationR import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME; Loading Loading @@ -672,9 +673,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); } } if (enableTalkbackKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); } if (enableVoiceAccessKeyGestures()) { if (enableVoiceAccessKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); } } Loading Loading @@ -4484,13 +4487,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub enable, shortcutType, shortcutTargets, userId)); enable, shortcutType, shortcutTargets, userId)); if (shortcutType == UserShortcutType.KEY_GESTURE) { if (shortcutType == UserShortcutType.KEY_GESTURE) { if(!enableTalkbackAndMagnifierKeyGestures() && if (!enableTalkbackAndMagnifierKeyGestures() (shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME) || && shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME)) { shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService)))) { Slog.w(LOG_TAG, Slog.w(LOG_TAG, "KEY_GESTURE type magnification and TalkBack shortcuts are disabled by " "KEY_GESTURE type magnification shortcuts are disabled by feature " + "feature flag"); + "flag"); return; return; } } if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( Loading @@ -4500,6 +4501,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub + "flag"); + "flag"); return; return; } } if (!enableTalkbackKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService))) { Slog.w(LOG_TAG, "KEY_GESTURE type TalkBack shortcuts are disabled by feature flag"); return; } if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultVoiceAccessService))) { R.string.config_defaultVoiceAccessService))) { Slog.w(LOG_TAG, Slog.w(LOG_TAG, Loading services/core/java/com/android/server/input/InputGestureManager.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.hardware.input.InputGestureData.createKeyTrigger; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; Loading Loading @@ -221,15 +222,17 @@ final class InputGestureManager { } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackAndMagnifierKeyGestures()) { systemShortcuts.add( systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_T, createKeyGesture(KeyEvent.KEYCODE_M, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, /* allowCaptureByFocusedWindow = */true /* allowCaptureByFocusedWindow = */true )); )); } if (enableTalkbackKeyGestures()) { systemShortcuts.add( systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_M, createKeyGesture(KeyEvent.KEYCODE_T, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER, /* allowCaptureByFocusedWindow = */true /* allowCaptureByFocusedWindow = */true )); )); } } Loading Loading
core/java/android/hardware/input/input_framework.aconfig +8 −1 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,14 @@ flag { flag { flag { name: "enable_talkback_and_magnifier_key_gestures" name: "enable_talkback_and_magnifier_key_gestures" namespace: "input" namespace: "input" description: "Adds key gestures for TalkBack and Magnification" description: "Adds key gestures for Magnification. TalkBack key gesture has been flagged separately under enable_talkback_key_gestures." bug: "375277034" } flag { name: "enable_talkback_key_gestures" namespace: "accessibility" description: "Adds key gesture for TalkBack" bug: "375277034" bug: "375277034" } } Loading
packages/SystemUI/src/com/android/systemui/accessibility/keygesture/ui/KeyGestureDialogStartable.kt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -68,6 +68,7 @@ constructor( if ( if ( !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableTalkbackAndMagnifierKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableSelectToSpeakKeyGestures() && !Flags.enableTalkbackKeyGestures() && !Flags.enableVoiceAccessKeyGestures() !Flags.enableVoiceAccessKeyGestures() ) { ) { return return Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/AccessibilityShortcutsSource.kt +5 −1 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.view.KeyboardShortcutGroup import android.view.KeyboardShortcutInfo import android.view.KeyboardShortcutInfo import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures import com.android.hardware.input.Flags.enableTalkbackKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.enableVoiceAccessKeyGestures import com.android.hardware.input.Flags.keyboardA11yShortcutControl import com.android.hardware.input.Flags.keyboardA11yShortcutControl import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.dagger.qualifiers.Main Loading Loading @@ -94,7 +95,7 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc ) ) } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackKeyGestures()) { shortcuts.add( shortcuts.add( // Toggle talkback: // Toggle talkback: // - Meta + Alt + T // - Meta + Alt + T Loading @@ -102,6 +103,9 @@ class AccessibilityShortcutsSource @Inject constructor(@Main private val resourc command(META_META_ON or META_ALT_ON, KEYCODE_T) command(META_META_ON or META_ALT_ON, KEYCODE_T) } } ) ) } if (enableTalkbackAndMagnifierKeyGestures()) { shortcuts.add( shortcuts.add( // Toggle magnification: // Toggle magnification: // - Meta + Alt + M // - Meta + Alt + M Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +15 −7 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ import static android.view.accessibility.AccessibilityManager.FlashNotificationR import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.ACCESSIBILITY_HEARING_AIDS_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME; import static com.android.internal.accessibility.AccessibilityShortcutController.MAGNIFICATION_COMPONENT_NAME; Loading Loading @@ -672,9 +673,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_ACTIVATE_SELECT_TO_SPEAK); } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackAndMagnifierKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION); } } if (enableTalkbackKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER); } if (enableVoiceAccessKeyGestures()) { if (enableVoiceAccessKeyGestures()) { supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); supportedGestures.add(KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_VOICE_ACCESS); } } Loading Loading @@ -4484,13 +4487,11 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub enable, shortcutType, shortcutTargets, userId)); enable, shortcutType, shortcutTargets, userId)); if (shortcutType == UserShortcutType.KEY_GESTURE) { if (shortcutType == UserShortcutType.KEY_GESTURE) { if(!enableTalkbackAndMagnifierKeyGestures() && if (!enableTalkbackAndMagnifierKeyGestures() (shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME) || && shortcutTargets.contains(MAGNIFICATION_CONTROLLER_NAME)) { shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService)))) { Slog.w(LOG_TAG, Slog.w(LOG_TAG, "KEY_GESTURE type magnification and TalkBack shortcuts are disabled by " "KEY_GESTURE type magnification shortcuts are disabled by feature " + "feature flag"); + "flag"); return; return; } } if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( if (!enableSelectToSpeakKeyGestures() && shortcutTargets.contains(mContext.getString( Loading @@ -4500,6 +4501,13 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub + "flag"); + "flag"); return; return; } } if (!enableTalkbackKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultAccessibilityService))) { Slog.w(LOG_TAG, "KEY_GESTURE type TalkBack shortcuts are disabled by feature flag"); return; } if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( if (!enableVoiceAccessKeyGestures() && shortcutTargets.contains(mContext.getString( R.string.config_defaultVoiceAccessService))) { R.string.config_defaultVoiceAccessService))) { Slog.w(LOG_TAG, Slog.w(LOG_TAG, Loading
services/core/java/com/android/server/input/InputGestureManager.java +7 −4 Original line number Original line Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.hardware.input.InputGestureData.createKeyTrigger; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableQuickSettingsPanelShortcut; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackAndMagnifierKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableSelectToSpeakKeyGestures; import static com.android.hardware.input.Flags.enableTalkbackKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.enableVoiceAccessKeyGestures; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; import static com.android.hardware.input.Flags.keyboardA11yShortcutControl; Loading Loading @@ -221,15 +222,17 @@ final class InputGestureManager { } } if (enableTalkbackAndMagnifierKeyGestures()) { if (enableTalkbackAndMagnifierKeyGestures()) { systemShortcuts.add( systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_T, createKeyGesture(KeyEvent.KEYCODE_M, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, /* allowCaptureByFocusedWindow = */true /* allowCaptureByFocusedWindow = */true )); )); } if (enableTalkbackKeyGestures()) { systemShortcuts.add( systemShortcuts.add( createKeyGesture(KeyEvent.KEYCODE_M, createKeyGesture(KeyEvent.KEYCODE_T, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyEvent.META_META_ON | KeyEvent.META_ALT_ON, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_MAGNIFICATION, KeyGestureEvent.KEY_GESTURE_TYPE_TOGGLE_SCREEN_READER, /* allowCaptureByFocusedWindow = */true /* allowCaptureByFocusedWindow = */true )); )); } } Loading