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

Commit a8d7cfda authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

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

parents 7660c634 c6ab679a
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -330,4 +330,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
@@ -165,6 +165,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;
@@ -484,6 +485,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) {
@@ -1244,6 +1250,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,
@@ -1755,6 +1769,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
@@ -2929,6 +2929,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());
@@ -3583,6 +3595,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
@@ -210,4 +210,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