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

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

[Flexiglass] make NSSL expanded in the QS

Make the NSSL.expandFraction 1.0, when we are in the QuickSettings scene,
to match the legacy behaviour. NSSL wants to draw HUNs in the QS, and
reads this flag state to do so.

Bug: 339181697
Test: atest NotificationStackAppearanceIntegrationTest
Flag: com.android.systemui.scene_container
Change-Id: Ia0d637eaf492b7f3a922c513cda1fc139f73a24d
parent 8db4979f
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -170,6 +170,22 @@ class NotificationStackAppearanceIntegrationTest : SysuiTestCase() {
            assertThat(isScrollable).isTrue()
        }

    @Test
    fun shadeExpansion_idleOnQs() =
        testScope.runTest {
            val transitionState =
                MutableStateFlow<ObservableTransitionState>(
                    ObservableTransitionState.Idle(currentScene = Scenes.QuickSettings)
                )
            sceneInteractor.setTransitionState(transitionState)
            val expandFraction by collectLastValue(scrollViewModel.expandFraction)
            assertThat(expandFraction).isEqualTo(1f)

            fakeSceneDataSource.changeScene(toScene = Scenes.QuickSettings)
            val isScrollable by collectLastValue(scrollViewModel.isScrollable)
            assertThat(isScrollable).isFalse()
        }

    @Test
    fun shadeExpansion_shadeToQs() =
        testScope.runTest {
+11 −7
Original line number Diff line number Diff line
@@ -70,10 +70,10 @@ constructor(
            ) { shadeExpansion, shadeMode, qsExpansion, transitionState, quickSettingsScene ->
                when (transitionState) {
                    is ObservableTransitionState.Idle -> {
                        if (transitionState.currentScene == Scenes.Lockscreen) {
                            1f
                        } else {
                            shadeExpansion
                        when (transitionState.currentScene) {
                            Scenes.Lockscreen,
                            Scenes.QuickSettings -> 1f
                            else -> shadeExpansion
                        }
                    }
                    is ObservableTransitionState.Transition -> {
@@ -162,9 +162,13 @@ constructor(
        stackAppearanceInteractor::setCurrentGestureOverscroll

    /** Whether the notification stack is scrollable or not. */
    val isScrollable: Flow<Boolean> = sceneInteractor.currentScene.map {
        sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) || it == Scenes.Lockscreen
    }.dumpWhileCollecting("isScrollable")
    val isScrollable: Flow<Boolean> =
        sceneInteractor.currentScene
            .map {
                sceneInteractor.isSceneInFamily(it, SceneFamilies.NotifShade) ||
                    it == Scenes.Lockscreen
            }
            .dumpWhileCollecting("isScrollable")

    /** Whether the notification stack is displayed in doze mode. */
    val isDozing: Flow<Boolean> by lazy {