Loading packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +5 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -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() = Loading Loading
packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +5 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 Loading
packages/SystemUI/tests/src/com/android/systemui/shade/GlanceableHubContainerControllerTest.kt +24 −0 Original line number Diff line number Diff line Loading @@ -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() = Loading