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

Commit 034e23da authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[Dual Shade] Apply notification clipping to shade bounds in Dual Shade.

Fix: 388475946
Fix: 391379412
Test: Manually by opening and scrolling the notifications shade on both
 narrow and wide screens, and ensuring they are clipped below the clock.
Test: Added a unit test scenario.
Test: Existing unit tests still pass.
Flag: com.android.systemui.scene_container
Change-Id: Id68f9a078c6e9328961ce907941cbf41d0169750
parent 0bf821f5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import com.android.systemui.kosmos.testScope
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.fakeSceneDataSource
import com.android.systemui.shade.domain.interactor.enableDualShade
import com.android.systemui.shade.domain.interactor.enableSingleShade
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_DELAYED_STACK_FADE_IN
@@ -69,6 +71,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() {
    @Test
    fun updateBounds() =
        testScope.runTest {
            kosmos.enableSingleShade()
            val radius = MutableStateFlow(32)
            val leftOffset = MutableStateFlow(0)
            val shape by
@@ -106,7 +109,7 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() {
                    )
                )

            // When: QuickSettings shows up full screen
            // When: QuickSettings shows up full screen on single shade.
            fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE)
            val transitionState =
                MutableStateFlow<ObservableTransitionState>(
@@ -115,6 +118,10 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() {
            sceneInteractor.setTransitionState(transitionState)
            // Then: shape is null
            assertThat(shape).isNull()

            // Same scenario on Dual Shade, shape should have clipping bounds
            kosmos.enableDualShade()
            assertThat(shape).isNotNull()
        }

    @Test
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ constructor(
        combine(shadeModeInteractor.shadeMode, shadeInteractor.qsExpansion) { shadeMode, qsExpansion
                ->
                when (shadeMode) {
                    is ShadeMode.Dual -> false
                    is ShadeMode.Dual,
                    is ShadeMode.Split -> true
                    is ShadeMode.Single -> qsExpansion < 0.5f
                }