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

Commit a1e0b946 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...

Merge "Map split from the current running app to META+CTRL+DPAD_LEFT and META+CTRL+DPAD_RIGHT" into tm-qpr-dev
parents 0de58934 054f7d80
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -331,4 +331,11 @@ oneway interface IStatusBar


    /** Called when requested to go to fullscreen from the active split app. */
    /** Called when requested to go to fullscreen from the active split app. */
    void goToFullscreenFromSplit();
    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 Original line Diff line number Diff line
@@ -565,13 +565,25 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
        statusBarWinController.registerCallback(mStatusBarWindowCallback);
        statusBarWinController.registerCallback(mStatusBarWindowCallback);
        mScreenshotHelper = new ScreenshotHelper(context);
        mScreenshotHelper = new ScreenshotHelper(context);


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

            // Listen for tracing state changes
            @Override
            @Override
            public void onTracingStateChanged(boolean enabled) {
            public void onTracingStateChanged(boolean enabled) {
                mSysUiState.setFlag(SYSUI_STATE_TRACING_ENABLED, enabled)
                mSysUiState.setFlag(SYSUI_STATE_TRACING_ENABLED, enabled)
                        .commitUpdate(mContext.getDisplayId());
                        .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;
        mCommandQueue = commandQueue;


+19 −0
Original line number Original line 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_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_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_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_NONE = 0;
    public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 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
         * @see IStatusBar#goToFullscreenFromSplit
         */
         */
        default void goToFullscreenFromSplit() {}
        default void goToFullscreenFromSplit() {}

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


    public CommandQueue(Context context) {
    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
    @Override
    public void requestAddTile(
    public void requestAddTile(
            @NonNull ComponentName componentName,
            @NonNull ComponentName componentName,
@@ -1758,6 +1772,11 @@ public class CommandQueue extends IStatusBar.Stub implements
                        mCallbacks.get(i).goToFullscreenFromSplit();
                        mCallbacks.get(i).goToFullscreenFromSplit();
                    }
                    }
                    break;
                    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 Original line Diff line number Diff line
@@ -2873,6 +2873,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    return key_consumed;
                    return key_consumed;
                }
                }
                break;
                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:
            case KeyEvent.KEYCODE_SLASH:
                if (down && repeatCount == 0 && event.isMetaPressed() && !keyguardOn) {
                if (down && repeatCount == 0 && event.isMetaPressed() && !keyguardOn) {
                    toggleKeyboardShortcutsMenu(event.getDeviceId());
                    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) {
    void launchHomeFromHotKey(int displayId) {
        launchHomeFromHotKey(displayId, true /* awakenFromDreams */, true /*respectKeyguard*/);
        launchHomeFromHotKey(displayId, true /* awakenFromDreams */, true /*respectKeyguard*/);
    }
    }
+7 −0
Original line number Original line Diff line number Diff line
@@ -184,4 +184,11 @@ public interface StatusBarManagerInternal {
     * Called when requested to go to fullscreen from the active split app.
     * Called when requested to go to fullscreen from the active split app.
     */
     */
    void goToFullscreenFromSplit();
    void goToFullscreenFromSplit();

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