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

Commit f4cc6c20 authored by Chandru S's avatar Chandru S
Browse files

Fix glanceable hub screen not getting blurred based on whether bouncer is showing or not

Bug: 388068805
Test: verified manually
Flag: com.android.systemui.scene_container
Change-Id: I54ac10438352f56ebac2e1b23051b361dd7f189b
parent 7e27ae70
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ import com.android.systemui.scene.data.repository.Transition
import com.android.systemui.scene.data.repository.setTransition
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.settings.fakeUserTracker
import com.android.systemui.shade.domain.interactor.shadeInteractor
@@ -947,11 +948,32 @@ class CommunalViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
        kosmos.runTest {
            val viewModel = createViewModel()
            val isUiBlurred by collectLastValue(viewModel.isUiBlurred)

            kosmos.sceneInteractor.changeScene(
                Scenes.Lockscreen,
                "go to lockscreen",
                hideAllOverlays = false,
            )
            kosmos.sceneInteractor.instantlyShowOverlay(Overlays.Bouncer, "go to bouncer")
            kosmos.sceneInteractor.setTransitionState(
                flowOf(
                    ObservableTransitionState.Idle(
                        sceneInteractor.currentScene.value,
                        setOf(Overlays.Bouncer),
                    )
                )
            )
            fakeKeyguardBouncerRepository.setPrimaryShow(true)
            runCurrent()

            assertThat(isUiBlurred).isTrue()

            fakeKeyguardBouncerRepository.setPrimaryShow(false)
            kosmos.sceneInteractor.instantlyHideOverlay(Overlays.Bouncer, "go to bouncer")
            kosmos.sceneInteractor.setTransitionState(
                flowOf(ObservableTransitionState.Idle(sceneInteractor.currentScene.value))
            )
            runCurrent()

            assertThat(isUiBlurred).isFalse()
        }

+12 −5
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import com.android.systemui.log.table.logDiffsForTable
import com.android.systemui.res.R
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.shade.data.repository.ShadeRepository
@@ -278,12 +279,18 @@ constructor(
    /** Whether the primary bouncer is showing or about to show soon. */
    @JvmField
    val primaryBouncerShowing: StateFlow<Boolean> =
        if (SceneContainerFlag.isEnabled) {
                sceneInteractorProvider.get().transitionState.map {
                    it.isIdle(Overlays.Bouncer) || it.isTransitioning(to = Overlays.Bouncer)
                }
            } else {
                combine(
                    bouncerRepository.primaryBouncerShow,
                    bouncerRepository.primaryBouncerShowingSoon,
                ) { showing, showingSoon ->
                    showing || showingSoon
                }
            }
            .stateIn(
                scope = applicationScope,
                started = SharingStarted.WhileSubscribed(),