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

Commit 2792670e authored by Josep del Rio's avatar Josep del Rio
Browse files

Remove duplicate language switch shortcut

Now that Ctrl+Space will take priority when the IME is active,
there is no need to keep the Meta+Space shortcut for language
switching, so this CL will remove it.

Bug: 309936958
Test: flashed on device
Change-Id: Id3d10717e59a1b9f671284491a683a1cdfebe066
Flag: NONE
parent cbb00109
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -612,7 +612,7 @@ public final class KeyboardShortcutListSearch {
    private static KeyboardShortcutMultiMappingGroup getMultiMappingInputShortcuts(
            Context context) {
        List<ShortcutMultiMappingInfo> shortcutMultiMappingInfoList = Arrays.asList(
                /* Switch input language (next language): Ctrl + Space or Meta + Space */
                /* Switch input language (next language): Ctrl + Space */
                new ShortcutMultiMappingInfo(
                        context.getString(R.string.input_switch_input_language_next),
                        null,
@@ -621,14 +621,9 @@ public final class KeyboardShortcutListSearch {
                                        context.getString(
                                                R.string.input_switch_input_language_next),
                                        KeyEvent.KEYCODE_SPACE, KeyEvent.META_CTRL_ON),
                                        null),
                                new ShortcutKeyGroup(new KeyboardShortcutInfo(
                                        context.getString(
                                                R.string.input_switch_input_language_next),
                                        KeyEvent.KEYCODE_SPACE, KeyEvent.META_META_ON),
                                        null))),
                /* Switch input language (previous language): */
                /* Ctrl + Shift + Space or Meta + Shift + Space */
                /* Ctrl + Shift + Space */
                new ShortcutMultiMappingInfo(
                        context.getString(R.string.input_switch_input_language_previous),
                        null,
@@ -638,12 +633,6 @@ public final class KeyboardShortcutListSearch {
                                                R.string.input_switch_input_language_previous),
                                        KeyEvent.KEYCODE_SPACE,
                                        KeyEvent.META_CTRL_ON | KeyEvent.META_SHIFT_ON),
                                        null),
                                new ShortcutKeyGroup(new KeyboardShortcutInfo(
                                        context.getString(
                                                R.string.input_switch_input_language_previous),
                                        KeyEvent.KEYCODE_SPACE,
                                        KeyEvent.META_META_ON | KeyEvent.META_SHIFT_ON),
                                        null)))
        );
        return new KeyboardShortcutMultiMappingGroup(
+0 −9
Original line number Diff line number Diff line
@@ -3638,15 +3638,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return true;
                }
                break;
            case KeyEvent.KEYCODE_SPACE:
                // Handle keyboard layout switching. (META + SPACE)
                if (firstDown && event.isMetaPressed()) {
                    int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
                    sendSwitchKeyboardLayout(event, direction);
                    logKeyboardSystemsEvent(event, KeyboardLogEvent.LANGUAGE_SWITCH);
                    return true;
                }
                break;
            case KeyEvent.KEYCODE_META_LEFT:
            case KeyEvent.KEYCODE_META_RIGHT:
                if (down) {
+0 −18
Original line number Diff line number Diff line
@@ -109,24 +109,6 @@ public class ModifierShortcutTests extends ShortcutKeyTestBase {
        mPhoneWindowManager.assertSwitchKeyboardLayout(-1);
    }

    /**
     * META + SPACE to switch keyboard layout.
     */
    @Test
    public void testMetaSpace() {
        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SPACE}, 0);
        mPhoneWindowManager.assertSwitchKeyboardLayout(1);
    }

    /**
     * META + SHIFT + SPACE to switch keyboard layout backwards.
     */
    @Test
    public void testMetaShiftSpace() {
        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SHIFT_LEFT, KEYCODE_SPACE}, 0);
        mPhoneWindowManager.assertSwitchKeyboardLayout(-1);
    }

    /**
     * CTRL + ALT + Z to enable accessibility service.
     */
+0 −7
Original line number Diff line number Diff line
@@ -132,13 +132,6 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
                {"LANGUAGE_SWITCH key -> Switch Keyboard Language",
                        new int[]{KeyEvent.KEYCODE_LANGUAGE_SWITCH},
                        KeyboardLogEvent.LANGUAGE_SWITCH, KeyEvent.KEYCODE_LANGUAGE_SWITCH, 0},
                {"Meta + Space -> Switch Keyboard Language",
                        new int[]{META_KEY, KeyEvent.KEYCODE_SPACE},
                        KeyboardLogEvent.LANGUAGE_SWITCH, KeyEvent.KEYCODE_SPACE, META_ON},
                {"Meta + Shift + Space -> Switch Keyboard Language",
                        new int[]{META_KEY, SHIFT_KEY, KeyEvent.KEYCODE_SPACE},
                        KeyboardLogEvent.LANGUAGE_SWITCH, KeyEvent.KEYCODE_SPACE,
                        META_ON | SHIFT_ON},
                {"META key -> Open App Drawer in Accessibility mode", new int[]{META_KEY},
                        KeyboardLogEvent.ACCESSIBILITY_ALL_APPS, META_KEY, META_ON},
                {"Meta + Alt -> Toggle CapsLock", new int[]{META_KEY, ALT_KEY},