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

Commit 62ae5dc7 authored by Josep del Río's avatar Josep del Río Committed by Android (Google) Code Review
Browse files

Merge "Modify bookmark shortcuts for platform alignment" into main

parents bb194230 ef208210
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -20,14 +20,10 @@

     Typical shortcuts (not necessarily defined here):
       'b': Browser
       'c': Contacts
       'p': Contacts
       'e': Email
       'g': GMail
       'k': Calendar
       'c': Calendar
       'm': Maps
       'p': Music
       's': SMS
       't': Talk
       'u': Calculator
       'y': YouTube
-->
@@ -38,7 +34,7 @@
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CONTACTS"
        androidprv:keycode="KEYCODE_C"
        androidprv:keycode="KEYCODE_P"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_EMAIL"
@@ -46,20 +42,12 @@
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CALENDAR"
        androidprv:keycode="KEYCODE_K"
        androidprv:keycode="KEYCODE_C"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_MAPS"
        androidprv:keycode="KEYCODE_M"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_MUSIC"
        androidprv:keycode="KEYCODE_P"
        androidprv:modifierState="META" />
    <bookmark
        role="android.app.role.SMS"
        androidprv:keycode="KEYCODE_S"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CALCULATOR"
        androidprv:keycode="KEYCODE_U"
+4 −14
Original line number Diff line number Diff line
@@ -20,14 +20,10 @@

     Typical shortcuts (not necessarily defined here):
       'b': Browser
       'c': Contacts
       'p': Contacts
       'e': Email
       'g': GMail
       'k': Calendar
       'c': Calendar
       'm': Maps
       'p': Music
       's': SMS
       't': Talk
       'u': Calculator
       'y': YouTube
-->
@@ -40,22 +36,16 @@
        shortcut="b" />
    <bookmark
        category="android.intent.category.APP_CONTACTS"
        shortcut="c" />
        shortcut="p" />
    <bookmark
        category="android.intent.category.APP_EMAIL"
        shortcut="e" />
    <bookmark
        category="android.intent.category.APP_CALENDAR"
        shortcut="k" />
        shortcut="c" />
    <bookmark
        category="android.intent.category.APP_MAPS"
        shortcut="m" />
    <bookmark
        category="android.intent.category.APP_MUSIC"
        shortcut="p" />
    <bookmark
        role="android.app.role.SMS"
        shortcut="s" />
    <bookmark
        category="android.intent.category.APP_CALCULATOR"
        shortcut="u" />
+2 −8
Original line number Diff line number Diff line
@@ -768,8 +768,6 @@ public final class KeyboardShortcutListSearch {
                    Intent.CATEGORY_APP_EMAIL,
                    Intent.CATEGORY_APP_CALENDAR,
                    Intent.CATEGORY_APP_MAPS,
                    Intent.CATEGORY_APP_MUSIC,
                    Intent.CATEGORY_APP_MESSAGING,
                    Intent.CATEGORY_APP_CALCULATOR,
            };
            String[] shortcutLabels = {
@@ -778,19 +776,15 @@ public final class KeyboardShortcutListSearch {
                    mContext.getString(R.string.keyboard_shortcut_group_applications_email),
                    mContext.getString(R.string.keyboard_shortcut_group_applications_calendar),
                    mContext.getString(R.string.keyboard_shortcut_group_applications_maps),
                    mContext.getString(R.string.keyboard_shortcut_group_applications_music),
                    mContext.getString(R.string.keyboard_shortcut_group_applications_sms),
                    mContext.getString(R.string.keyboard_shortcut_group_applications_calculator)
            };

            int[] keyCodes = {
                KeyEvent.KEYCODE_B,
                KeyEvent.KEYCODE_C,
                KeyEvent.KEYCODE_P,
                KeyEvent.KEYCODE_E,
                KeyEvent.KEYCODE_K,
                KeyEvent.KEYCODE_C,
                KeyEvent.KEYCODE_M,
                KeyEvent.KEYCODE_P,
                KeyEvent.KEYCODE_S,
                KeyEvent.KEYCODE_U,
            };

+2 −10
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CONTACTS"
        androidprv:keycode="KEYCODE_C"
        androidprv:keycode="KEYCODE_P"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_EMAIL"
@@ -30,20 +30,12 @@
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CALENDAR"
        androidprv:keycode="KEYCODE_K"
        androidprv:keycode="KEYCODE_C"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_MAPS"
        androidprv:keycode="KEYCODE_M"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_MUSIC"
        androidprv:keycode="KEYCODE_P"
        androidprv:modifierState="META" />
    <bookmark
        role="android.app.role.SMS"
        androidprv:keycode="KEYCODE_S"
        androidprv:modifierState="META" />
    <bookmark
        category="android.intent.category.APP_CALCULATOR"
        androidprv:keycode="KEYCODE_U"
+3 −6
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static android.view.KeyEvent.KEYCODE_E;
import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.KeyEvent.KEYCODE_H;
import static android.view.KeyEvent.KEYCODE_J;
import static android.view.KeyEvent.KEYCODE_K;
import static android.view.KeyEvent.KEYCODE_M;
import static android.view.KeyEvent.KEYCODE_META_LEFT;
import static android.view.KeyEvent.KEYCODE_N;
@@ -67,14 +66,12 @@ public class ModifierShortcutTests extends ShortcutKeyTestBase {
        // These shortcuts should align with those defined in
        // services/tests/wmtests/res/xml/bookmarks.xml
        INTENT_SHORTCUTS.append(KEYCODE_U, Intent.CATEGORY_APP_CALCULATOR);
        INTENT_SHORTCUTS.append(KEYCODE_C, Intent.CATEGORY_APP_CONTACTS);
        INTENT_SHORTCUTS.append(KEYCODE_P, Intent.CATEGORY_APP_CONTACTS);
        INTENT_SHORTCUTS.append(KEYCODE_E, Intent.CATEGORY_APP_EMAIL);
        INTENT_SHORTCUTS.append(KEYCODE_K, Intent.CATEGORY_APP_CALENDAR);
        INTENT_SHORTCUTS.append(KEYCODE_C, Intent.CATEGORY_APP_CALENDAR);
        INTENT_SHORTCUTS.append(KEYCODE_M, Intent.CATEGORY_APP_MAPS);
        INTENT_SHORTCUTS.append(KEYCODE_P, Intent.CATEGORY_APP_MUSIC);

        ROLE_SHORTCUTS.append(KEYCODE_B, RoleManager.ROLE_BROWSER);
        ROLE_SHORTCUTS.append(KEYCODE_S, RoleManager.ROLE_SMS);
    }
    private static final int ANY_DISPLAY_ID = 123;

@@ -109,7 +106,7 @@ public class ModifierShortcutTests extends ShortcutKeyTestBase {
        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SHIFT_LEFT, KEYCODE_B}, 0);
        mPhoneWindowManager.assertLaunchRole(RoleManager.ROLE_BROWSER);

        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SHIFT_LEFT, KEYCODE_C}, 0);
        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SHIFT_LEFT, KEYCODE_P}, 0);
        mPhoneWindowManager.assertLaunchCategory(Intent.CATEGORY_APP_CONTACTS);

        sendKeyCombination(new int[]{KEYCODE_META_LEFT, KEYCODE_SHIFT_LEFT, KEYCODE_J}, 0);
Loading