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

Commit d2273fad authored by William Leshner's avatar William Leshner Committed by Android (Google) Code Review
Browse files

Merge "Fix a bug with collapsing QS over hub." into main

parents 0a30919e c708e560
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.lockscreen.LockscreenSmartspaceController
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf
import com.android.systemui.util.kotlin.Quad
import com.android.systemui.util.kotlin.collectFlow
import java.util.function.Consumer
import javax.inject.Inject
@@ -409,11 +410,12 @@ constructor(
                shadeInteractor.isAnyFullyExpanded,
                shadeInteractor.isUserInteracting,
                shadeInteractor.isShadeFullyCollapsed,
                ::Triple,
                shadeInteractor.isQsExpanded,
                ::Quad,
            ),
            { (isFullyExpanded, isUserInteracting, isShadeFullyCollapsed) ->
            { (isFullyExpanded, isUserInteracting, isShadeFullyCollapsed, isQsExpanded) ->
                shadeConsumingTouches = isUserInteracting
                shadeShowing = !isShadeFullyCollapsed
                shadeShowing = isQsExpanded || !isShadeFullyCollapsed
                val expandedAndNotInteractive = isFullyExpanded && !isUserInteracting

                // If we ever are fully expanded and not interacting, capture this state as we
+24 −0
Original line number Diff line number Diff line
@@ -699,6 +699,30 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
            }
        }

    @Test
    fun onTouchEvent_qsExpanding_touchesNotDispatched() =
        with(kosmos) {
            testScope.runTest {
                // On lockscreen.
                goToScene(CommunalScenes.Blank)
                whenever(
                        notificationStackScrollLayoutController.isBelowLastNotification(
                            any(),
                            any(),
                        )
                    )
                    .thenReturn(true)

                // Shade is open slightly.
                shadeTestUtil.setQsExpansion(0.01f)
                testableLooper.processAllMessages()

                // Touches are not consumed.
                assertThat(underTest.onTouchEvent(DOWN_EVENT)).isFalse()
                verify(containerView, never()).onTouchEvent(DOWN_EVENT)
            }
        }

    @DisableFlags(FLAG_GLANCEABLE_HUB_V2)
    @Test
    fun onTouchEvent_bouncerInteracting_movesNotDispatched() =