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

Commit a5a5a983 authored by Keith Mok's avatar Keith Mok Committed by Gerrit Code Review
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 bfaa0f55
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -3632,18 +3632,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) {
@@ -5610,6 +5598,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_VOLUME_DOWN: