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

Commit db92f29b authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

Handle Home shortcut in PhoneWindowManager and back in native

Home: This is fully handled by System and can be handled in
PhoneWindowManager like all the other shortcuts.

Back: This event need to be sent to application for handling. Since,
meta based shortcuts or KeyEvents are not sent to application, we
need to pre-convert Meta+` and Meta+arrow_left to KEYCODE_BACK before
sending to App. This is handled on the native side.

Test: manual
Bug: 270242945
Bug: 270241579
Change-Id: I2b0773f3c3d1623a82740ac67f59a30f4d90d2c8
parent d460dea0
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -2977,7 +2977,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
                break;
            case KeyEvent.KEYCODE_H:
                if (down && event.isMetaPressed()) {
                if (event.isMetaPressed()) {
                    return handleHomeShortcuts(displayId, focusedToken, event);
                }
                break;
@@ -3018,11 +3018,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                if (down && event.isMetaPressed() && event.isCtrlPressed() && repeatCount == 0) {
                    enterStageSplitFromRunningApp(true /* leftOrTop */);
                    return key_consumed;
                } else if (!down && event.isMetaPressed()) {
                    boolean backKeyHandled = backKeyPress();
                    if (backKeyHandled) {
                        return key_consumed;
                    }
                }
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
@@ -3031,14 +3026,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return key_consumed;
                }
                break;
            case KeyEvent.KEYCODE_GRAVE:
                if (!down && event.isMetaPressed()) {
                    boolean backKeyHandled = backKeyPress();
                    if (backKeyHandled) {
                        return key_consumed;
                    }
                }
                break;
            case KeyEvent.KEYCODE_SLASH:
                if (down && repeatCount == 0 && event.isMetaPressed() && !keyguardOn) {
                    toggleKeyboardShortcutsMenu(event.getDeviceId());