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

Commit baa1ca4a authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Fix ShadeInteractor.isQsFullScreen on split shade

When we are Idle on the QuickSettingsScene, and we are in split shade,
isQsFullScreen should return false, because the QS is NOT taking up
the entire space in this state. This matches the legacy behaviour.

Fixes: 362977962
Test: EmptyShadeView and FooterView shows up correctly in split shade
Flag: com.android.systemui.scene_container
Change-Id: I80164b2642a7e3dfe96506edbd597c9a037009bc
parent 9de96295
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -99,14 +99,17 @@ constructor(
            .distinctUntilChanged()

    override val isQsFullscreen: Flow<Boolean> =
        sceneInteractor
            .resolveSceneFamily(SceneFamilies.QuickSettings)
            .flatMapLatestConflated { quickSettingsScene ->
        combine(
                shadeRepository.isShadeLayoutWide,
                sceneInteractor.resolveSceneFamily(SceneFamilies.QuickSettings),
                ::Pair
            )
            .flatMapLatestConflated { (isShadeLayoutWide, quickSettingsScene) ->
                sceneInteractor.transitionState
                    .map { state ->
                        when (state) {
                            is ObservableTransitionState.Idle ->
                                state.currentScene == quickSettingsScene
                                !isShadeLayoutWide && state.currentScene == quickSettingsScene
                            is ObservableTransitionState.Transition -> false
                        }
                    }
+19 −0
Original line number Diff line number Diff line
@@ -155,6 +155,25 @@ class ShadeInteractorSceneContainerImplTest : SysuiTestCase() {
            Truth.assertThat(actual).isFalse()
        }

    @Test
    fun qsFullscreen_falseWhenIdleSplitShadeQs() =
        testScope.runTest {
            val actual by collectLastValue(underTest.isQsFullscreen)

            // WHEN split shade is enabled and Idle on QuickSettings scene
            shadeTestUtil.setSplitShade(true)
            keyguardRepository.setStatusBarState(StatusBarState.SHADE)
            val transitionState =
                MutableStateFlow<ObservableTransitionState>(
                    ObservableTransitionState.Idle(Scenes.QuickSettings)
                )
            sceneInteractor.setTransitionState(transitionState)
            runCurrent()

            // THEN QS is not fullscreen
            Truth.assertThat(actual).isFalse()
        }

    @Test
    fun qsFullscreen_trueWhenIdleQS() =
        testScope.runTest {