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

Commit 85cf9ccc authored by Danesh Mondegarian's avatar Danesh Mondegarian Committed by Gerrit Code Review
Browse files

Merge "DeviceKeyHandler : Allow handling keyevents while screen off" into cm-10.2

parents e26c0ef3 0b8f6c01
Loading
Loading
Loading
Loading
+12 −12
Original line number Original line Diff line number Diff line
@@ -2272,18 +2272,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            mHandler.removeCallbacks(mBackLongPress);
            mHandler.removeCallbacks(mBackLongPress);
        }
        }


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

        // First we always handle the home key here, so applications
        // First we always handle the home key here, so applications
        // can never break it, although if keyguard is on, we do let
        // can never break it, although if keyguard is on, we do let
        // it handle it, because that gives us the correct 5 second
        // it handle it, because that gives us the correct 5 second
@@ -4189,6 +4177,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return result;
            return result;
        }
        }


        // 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.
        // Handle special keys.
        switch (keyCode) {
        switch (keyCode) {
            case KeyEvent.KEYCODE_ENDCALL: {
            case KeyEvent.KEYCODE_ENDCALL: {