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

Commit 082fc679 authored by Matt Pietal's avatar Matt Pietal
Browse files

Do not emit dismiss alpha when QS expanded

Handles special case of having a dismissible lockscreen,
swiping to show QS, then swiping from the navbar to dismiss
the keyguard

Fixes: 432096320
Test: atest KeyguardInteractorTest
Flag: EXEMPT bugfix
Change-Id: Icba6f3f8394bd6a5b270d7dc2f11267a863508e9
parent c5185531
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -381,6 +381,32 @@ class KeyguardInteractorTest : SysuiTestCase() {
            assertThat(dismissAlpha.size).isEqualTo(1)
        }

    @Test
    fun dismissAlpha_doesNotEmitWhenQsIsExpandedAndKeyguardDismissible() =
        testScope.runTest {
            val dismissAlpha by collectValues(underTest.dismissAlpha)
            assertThat(dismissAlpha[0]).isEqualTo(1f)
            assertThat(dismissAlpha.size).isEqualTo(1)

            keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)

            // QS is fully expanded
            shadeRepository.setQsExpansion(1f)

            // User begins to swipe up when dimissible
            repository.setStatusBarState(StatusBarState.KEYGUARD)
            repository.setKeyguardDismissible(true)

            shadeRepository.setLegacyShadeExpansion(0.5f)
            runCurrent()

            shadeRepository.setLegacyShadeExpansion(0.98f)
            runCurrent()

            assertThat(dismissAlpha[0]).isEqualTo(1f)
            assertThat(dismissAlpha.size).isEqualTo(1)
        }

    @Test
    @DisableSceneContainer
    fun dismissAlpha_onGlanceableHub_doesNotEmitWhenShadeResets() =
+1 −0
Original line number Diff line number Diff line
@@ -389,6 +389,7 @@ constructor(
                val currentKeyguardState = keyguardTransitionInteractor.currentKeyguardState.value
                val isKeyguardDismissible = isKeyguardDismissible.value

                if (shadeRepository.qsExpansion.value > 0f) return@transform
                if (
                    statusBarState.value == StatusBarState.KEYGUARD &&
                        isKeyguardDismissible &&