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

Commit 78e54236 authored by Abhishek Arpure's avatar Abhishek Arpure
Browse files

Physical Menu key press is not showing menu options

Issue is due to merge conflicts. Added missing changes
to generate virtual key press events.

Change-Id: If08f08df2166dbd840a051a0b6a2f2be70ff6017
parent c5201b63
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1267,6 +1267,14 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    private void triggerVirtualKeypress(final int keyCode) {
        InputManager im = InputManager.getInstance();
        long now = SystemClock.uptimeMillis();

        final KeyEvent downEvent = new KeyEvent(now, now, KeyEvent.ACTION_DOWN,
                keyCode, 0, 0, KeyCharacterMap.VIRTUAL_KEYBOARD, 0,
                KeyEvent.FLAG_FROM_SYSTEM, InputDevice.SOURCE_KEYBOARD);
        final KeyEvent upEvent = KeyEvent.changeAction(downEvent, KeyEvent.ACTION_UP);

        im.injectInputEvent(downEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
        im.injectInputEvent(upEvent, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
    }

    private void handleShortPressOnHome() {