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

Commit a522dc79 authored by Flavio Costa's avatar Flavio Costa Committed by Steve Kondik
Browse files

motus: handle envelope and explorer keys

Change-Id: I1371c16c31b12379e6312401df8cd44002f4d9cb
parent 391a6a3e
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -1899,6 +1899,18 @@ public final class Settings {
         */
        public static final String USER_DEFINED_KEY3_APP = "user_defined_key3_app";

        /**
         * Stores the uri of the define application for the envelope key
         * @hide
         */
        public static final String USER_DEFINED_KEY_ENVELOPE = "user_defined_key_envelope";

        /**
         * Stores the uri of the define application for the explorer key
         * @hide
         */
        public static final String USER_DEFINED_KEY_EXPLORER = "user_defined_key_explorer";

        /**
         * Specifies whether to prompt on the power dialog
         * @hide
+12 −1
Original line number Diff line number Diff line
@@ -1396,6 +1396,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            return handleQuickKeys(win, keyCode, down, keyguardOn);
        }

        if ("motus".equals(Build.DEVICE)
                && (keyCode == KeyEvent.KEYCODE_ENVELOPE || keyCode == KeyEvent.KEYCODE_EXPLORER)) {
            return handleQuickKeys(win, keyCode, down, keyguardOn);
        }

        // Shortcuts are invoked through Search+key, so intercept those here
        if (mSearchKeyPressed) {
            if (down && repeatCount == 0 && !keyguardOn) {
@@ -1418,7 +1423,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    /**
     * Quick Keys for Vision (HTC - G2)
     * Quick Keys
     */
    private boolean handleQuickKeys(WindowState win, int code, boolean down, boolean keyguardOn) {

@@ -1443,6 +1448,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        case KeyEvent.KEYCODE_USER3:
                            property = Settings.System.USER_DEFINED_KEY3_APP;
                            break;
                        case KeyEvent.KEYCODE_ENVELOPE:
                            property = Settings.System.USER_DEFINED_KEY_ENVELOPE;
                            break;
                        case KeyEvent.KEYCODE_EXPLORER:
                            property = Settings.System.USER_DEFINED_KEY_EXPLORER;
                            break;
                        default:
                            return false;
                    }