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

Commit 76c0e794 authored by Justin Weir's avatar Justin Weir
Browse files

Move isPanelExpanded to PanelExpansionInteractor

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Change-Id: I715c988a7d36cc91b73a70fb75b9c16601957993
parent 139426f7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ import com.android.systemui.recents.Recents;
import com.android.systemui.settings.DisplayTracker;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shade.domain.interactor.PanelExpansionInteractor;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.phone.StatusBarWindowCallback;
@@ -190,7 +190,7 @@ public class SystemActions implements CoreStartable, ConfigurationController.Con
    private final NotificationShadeWindowController mNotificationShadeController;
    private final KeyguardStateController mKeyguardStateController;
    private final ShadeController mShadeController;
    private final Lazy<ShadeViewController> mShadeViewController;
    private final Lazy<PanelExpansionInteractor> mPanelExpansionInteractor;
    private final StatusBarWindowCallback mNotificationShadeCallback;
    private boolean mDismissNotificationShadeActionRegistered;

@@ -200,14 +200,14 @@ public class SystemActions implements CoreStartable, ConfigurationController.Con
            NotificationShadeWindowController notificationShadeController,
            KeyguardStateController keyguardStateController,
            ShadeController shadeController,
            Lazy<ShadeViewController> shadeViewController,
            Lazy<PanelExpansionInteractor> panelExpansionInteractor,
            Optional<Recents> recentsOptional,
            DisplayTracker displayTracker) {
        mContext = context;
        mUserTracker = userTracker;
        mKeyguardStateController = keyguardStateController;
        mShadeController = shadeController;
        mShadeViewController = shadeViewController;
        mPanelExpansionInteractor = panelExpansionInteractor;
        mRecentsOptional = recentsOptional;
        mDisplayTracker = displayTracker;
        mReceiver = new SystemActionsBroadcastReceiver();
@@ -330,7 +330,7 @@ public class SystemActions implements CoreStartable, ConfigurationController.Con
    private void registerOrUnregisterDismissNotificationShadeAction() {
        Assert.isMainThread();

        if (mShadeViewController.get().isPanelExpanded()
        if (mPanelExpansionInteractor.get().isPanelExpanded()
                && !mKeyguardStateController.isShowing()) {
            if (!mDismissNotificationShadeActionRegistered) {
                mA11yManager.registerSystemAction(
+0 −6
Original line number Diff line number Diff line
@@ -31,12 +31,6 @@ import java.util.function.Consumer
 * @see NotificationPanelViewController
 */
interface ShadeViewController {
    /**
     * Returns whether the shade height is greater than zero or the shade is expecting a synthesized
     * down event.
     */
    val isPanelExpanded: Boolean

    /** Returns whether the shade is tracking touches for expand/collapse of the shade or QS. */
    val isTracking: Boolean

+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ interface PanelExpansionInteractor {
     */
    @Deprecated("Use SceneInteractor.currentScene instead.") val legacyPanelExpansion: Flow<Float>

    /**
     * Returns whether the shade height is greater than zero or the shade is expecting a synthesized
     * down event.
     */
    @Deprecated("Use ShadeInteractor.isAnyExpanded instead.") val isPanelExpanded: Boolean

    /**
     * This method should not be used anymore, you should probably use [.isShadeFullyOpen] instead.
     * It was overused as indicating if shade is open or we're on keyguard/AOD. Moving forward we
+2 −0
Original line number Diff line number Diff line
@@ -111,4 +111,6 @@ constructor(
    private fun SceneKey.isExpandable(): Boolean {
        return this == Scenes.Shade || this == Scenes.QuickSettings
    }

    override val isPanelExpanded = shadeInteractor.isAnyExpanded.value
}
+1 −5
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import com.android.systemui.shade.ShadeController;
import com.android.systemui.shade.ShadeViewController;
import com.android.systemui.shade.domain.interactor.PanelExpansionInteractor;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.disableflags.DisableFlagsLogger;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -97,7 +96,6 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
    private final StatusBarHideIconsForBouncerManager mStatusBarHideIconsForBouncerManager;
    private final PowerManager mPowerManager;
    private final Optional<Vibrator> mVibratorOptional;
    private final DisableFlagsLogger mDisableFlagsLogger;
    private final int mDisplayId;
    private final UserTracker mUserTracker;
    private final boolean mVibrateOnOpening;
@@ -137,7 +135,6 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
            StatusBarHideIconsForBouncerManager statusBarHideIconsForBouncerManager,
            PowerManager powerManager,
            Optional<Vibrator> vibratorOptional,
            DisableFlagsLogger disableFlagsLogger,
            @DisplayId int displayId,
            Lazy<CameraLauncher> cameraLauncherLazy,
            UserTracker userTracker,
@@ -165,7 +162,6 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba
        mStatusBarHideIconsForBouncerManager = statusBarHideIconsForBouncerManager;
        mPowerManager = powerManager;
        mVibratorOptional = vibratorOptional;
        mDisableFlagsLogger = disableFlagsLogger;
        mDisplayId = displayId;
        mCameraLauncherLazy = cameraLauncherLazy;
        mUserTracker = userTracker;
@@ -489,7 +485,7 @@ public class CentralSurfacesCommandQueueCallbacks implements CommandQueue.Callba

    @Override
    public void togglePanel() {
        if (mShadeViewController.isPanelExpanded()) {
        if (mPanelExpansionInteractor.isPanelExpanded()) {
            mShadeController.animateCollapseShade();
        } else {
            mShadeController.animateExpandShade();
Loading