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

Commit 865b5961 authored by Keith Mok's avatar Keith Mok Committed by Steve Kondik
Browse files

DeviceKeyHandler: Fix suspend gesture not working

A function for handling DeviceKey is mis-placed in
PhoneWindowManager.java when merging from cm-12.1

Change-Id: I5a5421c88216b70defaac69b732d99d506e1a2a6
parent 6e58fd35
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -3963,18 +3963,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            final boolean initialDown = event.getAction() == KeyEvent.ACTION_DOWN
                    && event.getRepeatCount() == 0;

        // Specific device key handling
        if (mDeviceKeyHandler != null) {
            try {
                // The device only should consume known keys.
                if (mDeviceKeyHandler.handleKeyEvent(event)) {
                    return null;
                }
            } catch (Exception e) {
                Slog.w(TAG, "Could not dispatch event to device key handler", e);
            }
        }

            // Check for fallback actions specified by the key character map.
            final FallbackAction fallbackAction;
            if (initialDown) {
@@ -6057,6 +6045,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0
                && event.getRepeatCount() == 0;

        // Specific device key handling
        if (mDeviceKeyHandler != null) {
            try {
                // The device only should consume known keys.
                if (mDeviceKeyHandler.handleKeyEvent(event)) {
                    return 0;
                }
            } catch (Exception e) {
                Slog.w(TAG, "Could not dispatch event to device key handler", e);
            }
        }

        // Handle special keys.
        switch (keyCode) {
            case KeyEvent.KEYCODE_BACK: {