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

Commit bf8c5674 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Add dreaming => alternate bouncer support

It's possible to transition from dreaming to
the alternate bouncer. Dreams can launch intents
and the shade can also show over a dream, which
makes it possible for the alternate bouncer
to show over a dream.

Fixes: 333073236
Flag: None
Test: atest FromDreamingTransitionInteractorTest
Test: manually show the alternate bouncer from
a dream (swipe down from the top on a dream to
see the notification shade and tap the settings
icon). Observe the alternate bouncer scrim. From
the AlternateBouncer, authenticate with FP and
observe that the device is entered and the SFPS
indicator is gone.

Change-Id: I41c85ce14b8b4e06eeeefd042121fc21824b0213
parent 697bd2a1
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ constructor(
    ) {

    override fun start() {
        listenForDreamingToAlternateBouncer()
        listenForDreamingToOccluded()
        listenForDreamingToGoneWhenDismissable()
        listenForDreamingToGoneFromBiometricUnlock()
@@ -75,6 +76,16 @@ constructor(
        listenForDreamingToPrimaryBouncer()
    }

    private fun listenForDreamingToAlternateBouncer() {
        scope.launch("$TAG#listenForDreamingToAlternateBouncer") {
            keyguardInteractor.alternateBouncerShowing
                .filterRelevantKeyguardStateAnd { isAlternateBouncerShowing ->
                    isAlternateBouncerShowing
                }
                .collect { startTransitionTo(KeyguardState.ALTERNATE_BOUNCER) }
        }
    }

    private fun listenForDreamingToGlanceableHub() {
        if (!communalHub()) return
        scope.launch("$TAG#listenForDreamingToGlanceableHub", mainDispatcher) {
+14 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.bouncer.data.repository.fakeKeyguardBouncerRepository
import com.android.systemui.keyguard.data.repository.FakeKeyguardTransitionRepository
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository
@@ -160,4 +161,17 @@ class FromDreamingTransitionInteractorTest : SysuiTestCase() {
                    to = KeyguardState.LOCKSCREEN,
                )
        }

    @Test
    fun testTransitionToAlternateBouncer() =
        testScope.runTest {
            kosmos.fakeKeyguardBouncerRepository.setAlternateVisible(true)
            runCurrent()

            assertThat(transitionRepository)
                .startedTransition(
                    from = KeyguardState.DREAMING,
                    to = KeyguardState.ALTERNATE_BOUNCER,
                )
        }
}