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

Commit 054f7d80 authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Map split from the current running app to META+CTRL+DPAD_LEFT and META+CTRL+DPAD_RIGHT

Fixes: 246661484
Test: https://recall.googleplex.com/projects/f4cc906f-d337-414e-aea8-d5434a0c6e88/sessions/06cc05b5-c032-40f3-af8b-3b90860d2f37
Change-Id: I8b293a0eb7e198fc2ff25c4c5a57dbd58f6be2f4
Merged-In: I8b293a0eb7e198fc2ff25c4c5a57dbd58f6be2f4
parent 73420439
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -331,4 +331,11 @@ oneway interface IStatusBar

    /** Called when requested to go to fullscreen from the active split app. */
    void goToFullscreenFromSplit();

    /**
     * Enters stage split from a current running app.
     *
     * @param leftOrTop indicates where the stage split is.
     */
    void enterStageSplitFromRunningApp(boolean leftOrTop);
}
+13 −1
Original line number Diff line number Diff line
@@ -565,13 +565,25 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        statusBarWinController.registerCallback(mStatusBarWindowCallback);
        mScreenshotHelper = new ScreenshotHelper(context);

        // Listen for tracing state changes
        commandQueue.addCallback(new CommandQueue.Callbacks() {

            // Listen for tracing state changes
            @Override
            public void onTracingStateChanged(boolean enabled) {
                mSysUiState.setFlag(SYSUI_STATE_TRACING_ENABLED, enabled)
                        .commitUpdate(mContext.getDisplayId());
            }

            @Override
            public void enterStageSplitFromRunningApp(boolean leftOrTop) {
                if (mOverviewProxy != null) {
                    try {
                        mOverviewProxy.enterStageSplitFromRunningApp(leftOrTop);
                    } catch (RemoteException e) {
                        Log.w(TAG_OPS, "Unable to enter stage split from the current running app");
                    }
                }
            }
        });
        mCommandQueue = commandQueue;

+19 −0
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class CommandQueue extends IStatusBar.Stub implements
    private static final int MSG_TILE_SERVICE_REQUEST_LISTENING_STATE = 68 << MSG_SHIFT;
    private static final int MSG_SHOW_REAR_DISPLAY_DIALOG = 69 << MSG_SHIFT;
    private static final int MSG_GO_TO_FULLSCREEN_FROM_SPLIT = 70 << MSG_SHIFT;
    private static final int MSG_ENTER_STAGE_SPLIT_FROM_RUNNING_APP = 71 << MSG_SHIFT;

    public static final int FLAG_EXCLUDE_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -486,6 +487,11 @@ public class CommandQueue extends IStatusBar.Stub implements
         * @see IStatusBar#goToFullscreenFromSplit
         */
        default void goToFullscreenFromSplit() {}

        /**
         * @see IStatusBar#enterStageSplitFromRunningApp
         */
        default void enterStageSplitFromRunningApp(boolean leftOrTop) {}
    }

    public CommandQueue(Context context) {
@@ -1247,6 +1253,14 @@ public class CommandQueue extends IStatusBar.Stub implements
        }
    }

    @Override
    public void enterStageSplitFromRunningApp(boolean leftOrTop) {
        synchronized (mLock) {
            mHandler.obtainMessage(MSG_ENTER_STAGE_SPLIT_FROM_RUNNING_APP,
                    leftOrTop).sendToTarget();
        }
    }

    @Override
    public void requestAddTile(
            @NonNull ComponentName componentName,
@@ -1758,6 +1772,11 @@ public class CommandQueue extends IStatusBar.Stub implements
                        mCallbacks.get(i).goToFullscreenFromSplit();
                    }
                    break;
                case MSG_ENTER_STAGE_SPLIT_FROM_RUNNING_APP:
                    for (int i = 0; i < mCallbacks.size(); i++) {
                        mCallbacks.get(i).enterStageSplitFromRunningApp((Boolean) msg.obj);
                    }
                    break;
            }
        }
    }
+19 −0
Original line number Diff line number Diff line
@@ -2873,6 +2873,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return key_consumed;
                }
                break;
            case KeyEvent.KEYCODE_DPAD_LEFT:
                if (down && event.isMetaPressed() && event.isCtrlPressed() && repeatCount == 0) {
                    enterStageSplitFromRunningApp(true /* leftOrTop */);
                    return key_consumed;
                }
                break;
            case KeyEvent.KEYCODE_DPAD_RIGHT:
                if (down && event.isMetaPressed() && event.isCtrlPressed() && repeatCount == 0) {
                    enterStageSplitFromRunningApp(false /* leftOrTop */);
                    return key_consumed;
                }
                break;
            case KeyEvent.KEYCODE_SLASH:
                if (down && repeatCount == 0 && event.isMetaPressed() && !keyguardOn) {
                    toggleKeyboardShortcutsMenu(event.getDeviceId());
@@ -3489,6 +3501,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    private void enterStageSplitFromRunningApp(boolean leftOrTop) {
        StatusBarManagerInternal statusbar = getStatusBarManagerInternal();
        if (statusbar != null) {
            statusbar.enterStageSplitFromRunningApp(leftOrTop);
        }
    }

    void launchHomeFromHotKey(int displayId) {
        launchHomeFromHotKey(displayId, true /* awakenFromDreams */, true /*respectKeyguard*/);
    }
+7 −0
Original line number Diff line number Diff line
@@ -184,4 +184,11 @@ public interface StatusBarManagerInternal {
     * Called when requested to go to fullscreen from the active split app.
     */
    void goToFullscreenFromSplit();

    /**
     * Enters stage split from a current running app.
     *
     * @see com.android.internal.statusbar.IStatusBar#enterStageSplitFromRunningApp
     */
    void enterStageSplitFromRunningApp(boolean leftOrTop);
}
Loading