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

Commit f3d295c5 authored by Charles Chen's avatar Charles Chen
Browse files

Make Some APIs in CommandQueue aware of multi-display (3/N)

By this CL, we could dispatch Callback to fragments on the specified
display. I also add some annotations for documenting.

TODO: 1. add tests for multi-display.
      2. make registerStatusBar be an IStatusBar API to propagate the
         information when a display is added or in the initial step.
      3. Introduce AutoHideController

Test: atest SystemUiTests
Bug: 117478341

Change-Id: I864600f929c1d0c8aa39274f30c17b213b754d86
parent 10ca70b0
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -69,6 +69,22 @@ public class StatusBarManager {
            | DISABLE_SYSTEM_INFO | DISABLE_RECENT | DISABLE_HOME | DISABLE_BACK | DISABLE_CLOCK
            | DISABLE_SEARCH;

    @IntDef(flag = true, prefix = {"DISABLE_"}, value = {
            DISABLE_NONE,
            DISABLE_EXPAND,
            DISABLE_NOTIFICATION_ICONS,
            DISABLE_NOTIFICATION_ALERTS,
            DISABLE_NOTIFICATION_TICKER,
            DISABLE_SYSTEM_INFO,
            DISABLE_HOME,
            DISABLE_RECENT,
            DISABLE_BACK,
            DISABLE_CLOCK,
            DISABLE_SEARCH
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface DisableFlags {}

    /**
     * Flag to disable quick settings.
     *
@@ -104,10 +120,25 @@ public class StatusBarManager {
    public static final int WINDOW_STATUS_BAR = 1;
    public static final int WINDOW_NAVIGATION_BAR = 2;

    @IntDef(flag = true, prefix = { "WINDOW_" }, value = {
        WINDOW_STATUS_BAR,
        WINDOW_NAVIGATION_BAR
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface WindowType {}

    public static final int WINDOW_STATE_SHOWING = 0;
    public static final int WINDOW_STATE_HIDING = 1;
    public static final int WINDOW_STATE_HIDDEN = 2;

    @IntDef(flag = true, prefix = { "WINDOW_STATE_" }, value = {
            WINDOW_STATE_SHOWING,
            WINDOW_STATE_HIDING,
            WINDOW_STATE_HIDDEN
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface WindowVisibleState {}

    public static final int CAMERA_LAUNCH_SOURCE_WIGGLE = 0;
    public static final int CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP = 1;
    public static final int CAMERA_LAUNCH_SOURCE_LIFT_TRIGGER = 2;
+2 −2
Original line number Diff line number Diff line
@@ -132,9 +132,9 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks
    }

    @Override
    public void disable(int state1, int state2, boolean animate) {
    public void disable(int displayId, int state1, int state2, boolean animate) {
        final boolean disabled = (state2 & DISABLE2_GLOBAL_ACTIONS) != 0;
        if (disabled == mDisabled) return;
        if (displayId != mContext.getDisplayId() || disabled == mDisabled) return;
        mDisabled = disabled;
        if (disabled && mGlobalActions != null) {
            mGlobalActions.dismissDialog();
+4 −1
Original line number Diff line number Diff line
@@ -215,7 +215,10 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca
    }

    @Override
    public void disable(int state1, int state2, boolean animate) {
    public void disable(int displayId, int state1, int state2, boolean animate) {
        if (displayId != getContext().getDisplayId()) {
            return;
        }
        state2 = mRemoteInputQuickSettingsDisabler.adjustDisableFlags(state2);

        final boolean disabled = (state2 & DISABLE2_QUICK_SETTINGS) != 0;
+4 −2
Original line number Diff line number Diff line
@@ -54,9 +54,11 @@ public class Recents extends SystemUI implements CommandQueue.Callbacks {
    }

    @Override
    public void appTransitionFinished() {
    public void appTransitionFinished(int displayId) {
        if (mContext.getDisplayId() == displayId) {
            mImpl.onAppTransitionFinished();
        }
    }

    public void growRecents() {
        mImpl.growRecents();
+246 −66

File changed.

Preview size limit exceeded, changes collapsed.

Loading