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

Commit ce0c13a1 authored by Michael Wright's avatar Michael Wright
Browse files

Mark all Meta combos as system combos

Also make a meta-tab a recents accelerator.

Bug: 14066931
Change-Id: Iac6aab276e4e16d5f70c92a5a03172bd81559afa
parent 5f72e168
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1722,6 +1722,11 @@ public class KeyEvent extends InputEvent implements Parcelable {
        return false;
    }

    /** @hide */
    public static final boolean isMetaKey(int keyCode) {
        return keyCode == KeyEvent.KEYCODE_META_LEFT || keyCode == KeyEvent.KEYCODE_META_RIGHT;
    }

    /** {@inheritDoc} */
    @Override
    public final int getDeviceId() {
+6 −5
Original line number Diff line number Diff line
@@ -2138,7 +2138,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

        // Cancel any pending meta actions if we see any other keys being pressed between the down
        // of the meta key and its corresponding up.
        if (mPendingMetaAction && keyCode != KeyEvent.KEYCODE_META_LEFT) {
        if (mPendingMetaAction && KeyEvent.isMetaKey(keyCode)) {
            mPendingMetaAction = false;
        }

@@ -2343,11 +2343,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                        UserHandle.CURRENT_OR_SELF);
            }
            return -1;
        } else if (keyCode == KeyEvent.KEYCODE_META_LEFT) {
        } else if (KeyEvent.isMetaKey(keyCode)) {
            if (down) {
                mPendingMetaAction = true;
            } else if (mPendingMetaAction) {
                mPendingMetaAction = false;
                launchAssistAction();
            }
            return -1;
@@ -2426,7 +2425,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        if (down && repeatCount == 0 && keyCode == KeyEvent.KEYCODE_TAB) {
            if (mRecentAppsHeldModifiers == 0 && !keyguardOn) {
                final int shiftlessModifiers = event.getModifiers() & ~KeyEvent.META_SHIFT_MASK;
                if (KeyEvent.metaStateHasModifiers(shiftlessModifiers, KeyEvent.META_ALT_ON)) {
                if (KeyEvent.metaStateHasModifiers(shiftlessModifiers, KeyEvent.META_ALT_ON)
                        || KeyEvent.metaStateHasModifiers(
                        shiftlessModifiers, KeyEvent.META_META_ON)) {
                    mRecentAppsHeldModifiers = shiftlessModifiers;
                    showRecentApps(true);
                    return -1;
@@ -2459,7 +2460,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        // Reserve all the META modifier combos for system behavior
        if ((metaState & KeyEvent.META_META_LEFT_ON) != 0) {
        if ((metaState & KeyEvent.META_META_ON) != 0) {
            return -1;
        }