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

Commit 297af250 authored by Danny Baumann's avatar Danny Baumann Committed by Gerrit Code Review
Browse files

Merge "DeviceKeyHandler: Increase handler priority" into cm-10.1

parents 2b7a3780 95f6c140
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -2218,6 +2218,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            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
        // can never break it, although if keyguard is on, we do let
        // it handle it, because that gives us the correct 5 second
@@ -2550,18 +2562,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return -1;
        }

        // 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);
            }
        }

        // Let the application handle the key.
        return 0;
    }