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

Commit e51ac58c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Shortcut helper now shows correct application launch shortcuts." into main

parents 5eae77ad 9ded1170
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ import android.view.IWallpaperVisibilityListener;
import android.view.IWindow;
import android.view.IWindowSession;
import android.view.IWindowSessionCallback;
import android.view.KeyboardShortcutGroup;
import android.view.KeyEvent;
import android.view.InputEvent;
import android.view.InsetsState;
@@ -1095,4 +1096,11 @@ interface IWindowManager

    boolean transferTouchGesture(in InputTransferToken transferFromToken,
            in InputTransferToken transferToToken);

    /**
     * Request the application launch keyboard shortcuts the system has defined.
     *
     * @param deviceId The id of the {@link InputDevice} that will handle the shortcut.
     */
    KeyboardShortcutGroup getApplicationLaunchKeyboardShortcuts(int deviceId);
}
+3 −0
Original line number Diff line number Diff line
package android.view;

@JavaOnlyStableParcelable parcelable KeyboardShortcutGroup;
+18 −1
Original line number Diff line number Diff line
@@ -81,12 +81,29 @@ public final class KeyboardShortcutInfo implements Parcelable {
     *     {@link KeyEvent#META_SYM_ON}.
     */
    public KeyboardShortcutInfo(CharSequence label, char baseCharacter, int modifiers) {
        this(label, null, baseCharacter, modifiers);
    }

    /**
     * @param label The label that identifies the action performed by this shortcut.
     * @param icon An icon that identifies the action performed by this shortcut.
     * @param baseCharacter The character that triggers the shortcut.
     * @param modifiers The set of modifiers that, combined with the key, trigger the shortcut.
     *     These should be a combination of {@link KeyEvent#META_CTRL_ON},
     *     {@link KeyEvent#META_SHIFT_ON}, {@link KeyEvent#META_META_ON},
     *     {@link KeyEvent#META_ALT_ON}, {@link KeyEvent#META_FUNCTION_ON} and
     *     {@link KeyEvent#META_SYM_ON}.
     *
     * @hide
     */
    public KeyboardShortcutInfo(
            CharSequence label, @Nullable Icon icon, char baseCharacter, int modifiers) {
        mLabel = label;
        checkArgument(baseCharacter != MIN_VALUE);
        mBaseCharacter = baseCharacter;
        mKeycode = KeyEvent.KEYCODE_UNKNOWN;
        mModifiers = modifiers;
        mIcon = null;
        mIcon = icon;
    }

    private KeyboardShortcutInfo(Parcel source) {
+9 −0
Original line number Diff line number Diff line
@@ -1667,6 +1667,15 @@ public interface WindowManager extends ViewManager {
     */
    public void requestAppKeyboardShortcuts(final KeyboardShortcutsReceiver receiver, int deviceId);

    /**
     * Request the application launch keyboard shortcuts the system has defined.
     *
     * @param deviceId The id of the {@link InputDevice} that will handle the shortcut.
     *
     * @hide
     */
    KeyboardShortcutGroup getApplicationLaunchKeyboardShortcuts(int deviceId);

    /**
     * Request for ime's keyboard shortcuts to be retrieved asynchronously.
     *
+10 −0
Original line number Diff line number Diff line
@@ -236,6 +236,16 @@ public final class WindowManagerImpl implements WindowManager {
        }
    }

    @Override
    public KeyboardShortcutGroup getApplicationLaunchKeyboardShortcuts(int deviceId) {
        try {
            return WindowManagerGlobal.getWindowManagerService()
                    .getApplicationLaunchKeyboardShortcuts(deviceId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    @Override
    public void requestImeKeyboardShortcuts(
            final KeyboardShortcutsReceiver receiver, int deviceId) {
Loading