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

Commit 3c616053 authored by Josep del Rio's avatar Josep del Rio
Browse files

Fix all apps key

The all apps key currently dispatches an intent; however, this
intent is no longer received by the launcher; the Meta key uses
an accessibility feature in order to trigger it directly.

This intent is still being used in TV, so this CL will keep the
current functionality for TV, and use the new one for the other
platforms.

Bug: 348371690
Test: Flashed on device, adb shell input keyevent ALL_APPS
Flag: EXEMPT bugfix
Change-Id: Ib266618dd2cd040f128b65e2d98bdbe91da6bc84
parent e5b7d47d
Loading
Loading
Loading
Loading
+18 −8
Original line number Original line Diff line number Diff line
@@ -2090,8 +2090,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    "Home - Long Press");
                    "Home - Long Press");
            switch (mLongPressOnHomeBehavior) {
            switch (mLongPressOnHomeBehavior) {
                case LONG_PRESS_HOME_ALL_APPS:
                case LONG_PRESS_HOME_ALL_APPS:
                    logKeyboardSystemsEvent(event, KeyboardLogEvent.ALL_APPS);
                    if (mHasFeatureLeanback) {
                        launchAllAppsAction();
                        launchAllAppsAction();
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.ALL_APPS);
                    } else {
                        launchAllAppsViaA11y();
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.ACCESSIBILITY_ALL_APPS);
                    }
                    break;
                    break;
                case LONG_PRESS_HOME_ASSIST:
                case LONG_PRESS_HOME_ASSIST:
                    logKeyboardSystemsEvent(event, KeyboardLogEvent.LAUNCH_ASSISTANT);
                    logKeyboardSystemsEvent(event, KeyboardLogEvent.LAUNCH_ASSISTANT);
@@ -3683,12 +3688,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                }
                }
                break;
                break;
            case KeyEvent.KEYCODE_ALL_APPS:
            case KeyEvent.KEYCODE_ALL_APPS:
                if (!down) {
                if (firstDown) {
                    if (mHasFeatureLeanback) {
                        mHandler.removeMessages(MSG_HANDLE_ALL_APPS);
                        mHandler.removeMessages(MSG_HANDLE_ALL_APPS);
                        Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS);
                        Message msg = mHandler.obtainMessage(MSG_HANDLE_ALL_APPS);
                        msg.setAsynchronous(true);
                        msg.setAsynchronous(true);
                        msg.sendToTarget();
                        msg.sendToTarget();
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.ALL_APPS);
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.ALL_APPS);
                    } else {
                        launchAllAppsViaA11y();
                        logKeyboardSystemsEvent(event, KeyboardLogEvent.ACCESSIBILITY_ALL_APPS);
                    }
                }
                }
                return true;
                return true;
            case KeyEvent.KEYCODE_NOTIFICATION:
            case KeyEvent.KEYCODE_NOTIFICATION:
+10 −8
Original line number Original line Diff line number Diff line
@@ -132,8 +132,9 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
                        KeyboardLogEvent.VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_DOWN, 0},
                        KeyboardLogEvent.VOLUME_DOWN, KeyEvent.KEYCODE_VOLUME_DOWN, 0},
                {"VOLUME_MUTE key -> Mute Volume", new int[]{KeyEvent.KEYCODE_VOLUME_MUTE},
                {"VOLUME_MUTE key -> Mute Volume", new int[]{KeyEvent.KEYCODE_VOLUME_MUTE},
                        KeyboardLogEvent.VOLUME_MUTE, KeyEvent.KEYCODE_VOLUME_MUTE, 0},
                        KeyboardLogEvent.VOLUME_MUTE, KeyEvent.KEYCODE_VOLUME_MUTE, 0},
                {"ALL_APPS key -> Open App Drawer", new int[]{KeyEvent.KEYCODE_ALL_APPS},
                {"ALL_APPS key -> Open App Drawer in Accessibility mode",
                        KeyboardLogEvent.ALL_APPS, KeyEvent.KEYCODE_ALL_APPS, 0},
                        new int[]{KeyEvent.KEYCODE_ALL_APPS},
                        KeyboardLogEvent.ACCESSIBILITY_ALL_APPS, KeyEvent.KEYCODE_ALL_APPS, 0},
                {"SEARCH key -> Launch Search Activity", new int[]{KeyEvent.KEYCODE_SEARCH},
                {"SEARCH key -> Launch Search Activity", new int[]{KeyEvent.KEYCODE_SEARCH},
                        KeyboardLogEvent.LAUNCH_SEARCH, KeyEvent.KEYCODE_SEARCH, 0},
                        KeyboardLogEvent.LAUNCH_SEARCH, KeyEvent.KEYCODE_SEARCH, 0},
                {"LANGUAGE_SWITCH key -> Switch Keyboard Language",
                {"LANGUAGE_SWITCH key -> Switch Keyboard Language",
@@ -259,14 +260,15 @@ public class ShortcutLoggingTests extends ShortcutKeyTestBase {
                {"Long press META + H -> Launch assistant",
                {"Long press META + H -> Launch assistant",
                        new int[]{META_KEY, KeyEvent.KEYCODE_H}, LONG_PRESS_HOME_ASSIST,
                        new int[]{META_KEY, KeyEvent.KEYCODE_H}, LONG_PRESS_HOME_ASSIST,
                        KeyboardLogEvent.LAUNCH_ASSISTANT, KeyEvent.KEYCODE_H, META_ON},
                        KeyboardLogEvent.LAUNCH_ASSISTANT, KeyEvent.KEYCODE_H, META_ON},
                {"Long press HOME key -> Open App Drawer",
                {"Long press HOME key -> Open App Drawer in Accessibility mode",
                        new int[]{KeyEvent.KEYCODE_HOME}, LONG_PRESS_HOME_ALL_APPS,
                        new int[]{KeyEvent.KEYCODE_HOME}, LONG_PRESS_HOME_ALL_APPS,
                        KeyboardLogEvent.ALL_APPS, KeyEvent.KEYCODE_HOME, 0},
                        KeyboardLogEvent.ACCESSIBILITY_ALL_APPS, KeyEvent.KEYCODE_HOME, 0},
                {"Long press META + ENTER -> Open App Drawer",
                {"Long press META + ENTER -> Open App Drawer in Accessibility mode",
                        new int[]{META_KEY, KeyEvent.KEYCODE_ENTER}, LONG_PRESS_HOME_ALL_APPS,
                        new int[]{META_KEY, KeyEvent.KEYCODE_ENTER}, LONG_PRESS_HOME_ALL_APPS,
                        KeyboardLogEvent.ALL_APPS, KeyEvent.KEYCODE_ENTER, META_ON},
                        KeyboardLogEvent.ACCESSIBILITY_ALL_APPS, KeyEvent.KEYCODE_ENTER, META_ON},
                {"Long press META + H -> Open App Drawer", new int[]{META_KEY, KeyEvent.KEYCODE_H},
                {"Long press META + H -> Open App Drawer in Accessibility mode",
                        LONG_PRESS_HOME_ALL_APPS, KeyboardLogEvent.ALL_APPS,
                        new int[]{META_KEY, KeyEvent.KEYCODE_H},
                        LONG_PRESS_HOME_ALL_APPS, KeyboardLogEvent.ACCESSIBILITY_ALL_APPS,
                        KeyEvent.KEYCODE_H, META_ON}};
                        KeyEvent.KEYCODE_H, META_ON}};
    }
    }