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

Commit b2bd8807 authored by Justin Weir's avatar Justin Weir
Browse files

Move isTracking to PanelExpansionInteractor

Flag: ACONFIG com.android.systemui.scene_container DEVELOPMENT
Test: Updated and ran affected test
Bug: 303267342
Change-Id: I50679b666e30894ef1fe9729233f655e3b7a2a7c
parent 317827fe
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -31,11 +31,8 @@ import java.util.function.Consumer
 * @see NotificationPanelViewController
 */
interface ShadeViewController {
    /** Returns whether the shade is tracking touches for expand/collapse of the shade or QS. */
    val isTracking: Boolean

    /** Returns whether the shade's top level view is enabled. */
    val isViewEnabled: Boolean
    @Deprecated("No longer supported. Do not add new calls to this.") val isViewEnabled: Boolean

    /** Returns whether status bar icons should be hidden when the shade is expanded. */
    fun shouldHideStatusBarIconsWhenExpanded(): Boolean
+3 −0
Original line number Diff line number Diff line
@@ -66,4 +66,7 @@ interface PanelExpansionInteractor {

    /** Returns whether the shade is in the process of collapsing. */
    @Deprecated("Use ShadeAnimationInteractor instead") val isCollapsing: Boolean

    /** Returns whether the shade is tracking touches for expand/collapse of the shade or QS. */
    @Deprecated("Use sceneInteractor.isTransitionUserInputOngoing instead") val isTracking: Boolean
}
+13 −8
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@ import kotlinx.coroutines.flow.map
class PanelExpansionInteractorImpl
@Inject
constructor(
    sceneInteractor: SceneInteractor,
    shadeInteractor: ShadeInteractor,
    shadeAnimationInteractor: ShadeAnimationInteractor,
    private val sceneInteractor: SceneInteractor,
    private val shadeInteractor: ShadeInteractor,
    private val shadeAnimationInteractor: ShadeAnimationInteractor,
) : PanelExpansionInteractor {

    /**
@@ -99,18 +99,23 @@ constructor(
        "depends on the state you check, use {@link #isShadeFullyExpanded()},\n" +
            "{@link #isOnAod()}, {@link #isOnKeyguard()} instead."
    )
    override val isFullyExpanded = shadeInteractor.isAnyFullyExpanded.value
    override val isFullyExpanded get() = shadeInteractor.isAnyFullyExpanded.value

    @Deprecated("Use !ShadeInteractor.isAnyExpanded instead")
    override val isFullyCollapsed = !shadeInteractor.isAnyExpanded.value
    override val isFullyCollapsed get() = !shadeInteractor.isAnyExpanded.value

    @Deprecated("Use ShadeAnimationInteractor instead")
    override val isCollapsing =
    override val isCollapsing get() =
        shadeAnimationInteractor.isAnyCloseAnimationRunning.value ||
            shadeAnimationInteractor.isLaunchingActivity.value

    @Deprecated("Use sceneInteractor.isTransitionUserInputOngoing instead")
    override val isTracking get() = sceneInteractor.isTransitionUserInputOngoing.value

    @Deprecated("Use ShadeInteractor.isAnyExpanded instead.")
    override val isPanelExpanded get() = shadeInteractor.isAnyExpanded.value

    private fun SceneKey.isExpandable(): Boolean {
        return this == Scenes.Shade || this == Scenes.QuickSettings
    }

    override val isPanelExpanded = shadeInteractor.isAnyExpanded.value
}
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ public class StatusBarHeadsUpChangeListener implements OnHeadsUpChangedListener,
            boolean bypassKeyguard = mKeyguardBypassController.getBypassEnabled()
                    && mStatusBarStateController.getState() == StatusBarState.KEYGUARD;
            if (!mPanelExpansionInteractor.isFullyCollapsed()
                    || mShadeViewController.isTracking()
                    || mPanelExpansionInteractor.isTracking()
                    || bypassKeyguard) {
                // We are currently tracking or is open and the shade doesn't need to
                //be kept
+1 −1
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ class StatusBarNotificationPresenter implements NotificationPresenter, CommandQu
    /** Called when the shade has been emptied to attempt to close the shade */
    private void maybeClosePanelForShadeEmptied() {
        if (CLOSE_PANEL_WHEN_EMPTIED
                && !mNotificationPanel.isTracking()
                && !mPanelExpansionInteractor.isTracking()
                && !mQsController.getExpanded()
                && mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED
                && !isCollapsing()) {