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

Commit b38d00fd authored by Josep del Rio's avatar Josep del Rio
Browse files

Add keyboard shortcut for desktop mode

At the moment there is not a shortcut for desktop mode, so having
one makes accessing it more convenient.

Bug: 318366520
Flag: ACONFIG com.android.wm.shell.enable_desktop_windowing DEVELOPMENT
Test: Flashed on device
Change-Id: I4bd0ba7ed5af4972d3d44ab4719a557bac7f6b7a
parent 27ad7ae6
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -227,7 +227,12 @@ public final class KeyboardMetricsCollector {
                "LAUNCH_DEFAULT_FITNESS"),
        LAUNCH_APPLICATION_BY_PACKAGE_NAME(
                FrameworkStatsLog.KEYBOARD_SYSTEMS_EVENT_REPORTED__KEYBOARD_SYSTEM_EVENT__LAUNCH_APPLICATION_BY_PACKAGE_NAME,
                "LAUNCH_APPLICATION_BY_PACKAGE_NAME");
                "LAUNCH_APPLICATION_BY_PACKAGE_NAME"),
        DESKTOP_MODE(
                FrameworkStatsLog
                        .KEYBOARD_SYSTEMS_EVENT_REPORTED__KEYBOARD_SYSTEM_EVENT__DESKTOP_MODE,
                "DESKTOP_MODE");


        private final int mValue;
        private final String mName;
+10 −0
Original line number Diff line number Diff line
@@ -3509,6 +3509,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    }
                }
                break;
            case KeyEvent.KEYCODE_DPAD_DOWN:
                if (firstDown && event.isMetaPressed() && event.isCtrlPressed()) {
                    StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
                    if (statusbar != null) {
                        statusbar.enterDesktop(event.getDisplayId());
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.DESKTOP_MODE);
                        return true;
                    }
                }
                break;
            case KeyEvent.KEYCODE_DPAD_LEFT:
                if (firstDown && event.isMetaPressed()) {
                    if (event.isCtrlPressed()) {
+5 −1
Original line number Diff line number Diff line
@@ -223,7 +223,11 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
                        KeyboardLogEvent.LAUNCH_DEFAULT_MAPS, KeyEvent.KEYCODE_M, META_ON},
                {"Meta + S -> Launch Default Messaging App",
                        new int[]{META_KEY, KeyEvent.KEYCODE_S},
                        KeyboardLogEvent.LAUNCH_DEFAULT_MESSAGING, KeyEvent.KEYCODE_S, META_ON}};
                        KeyboardLogEvent.LAUNCH_DEFAULT_MESSAGING, KeyEvent.KEYCODE_S, META_ON},
                {"Meta + Ctrl + DPAD_DOWN -> Enter desktop mode",
                        new int[]{META_KEY, CTRL_KEY, KeyEvent.KEYCODE_DPAD_DOWN},
                        KeyboardLogEvent.DESKTOP_MODE, KeyEvent.KEYCODE_DPAD_DOWN,
                        META_ON | CTRL_ON}};
    }

    @Keep