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

Commit 0c969e27 authored by Beverly's avatar Beverly
Browse files

Drop the first keyguardAuthenticatedBiometricsHandled evaluation

Since the event is derived from a StateFlow, the starting state
is always null. The transition from alternate bouncer to gone
should only be triggerd on subsequent updates to the value.

Flag: EXEMPT bugfix
Test: atest FromAlternateBouncerTransitionInteractorTest
Test: enroll UDFPS, set a timer for 10s, go to lockscreen
and manually trigger the alternate bouncer, wait for
the timer to go off (and show the clock activity), navigate
back to the lockscreen and observe UDFPS icon is visible
(and check keyguard transition states were updated correctly)
Fixes: 345373593

Change-Id: Idb1c077e993345bf04d38ebee7615cf5429e25f8
parent f8a9bb95
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -90,7 +90,11 @@ class FromAlternateBouncerTransitionInteractorTest : SysuiTestCase() {
            )
            reset(transitionRepository)

            kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(null)
            kosmos.fakeKeyguardRepository.setKeyguardOccluded(true)
            runCurrent()
            assertThat(transitionRepository).noTransitionsStarted()

            kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(true)
            runCurrent()
            kosmos.fakeKeyguardBouncerRepository.setKeyguardAuthenticatedBiometrics(null)
+4 −1
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
@@ -168,7 +169,9 @@ constructor(
                    keyguardInteractor.isKeyguardGoingAway.filter { it }.map {}, // map to Unit
                    keyguardInteractor.isKeyguardOccluded.flatMapLatest { keyguardOccluded ->
                        if (keyguardOccluded) {
                            primaryBouncerInteractor.keyguardAuthenticatedBiometricsHandled
                            primaryBouncerInteractor.keyguardAuthenticatedBiometricsHandled.drop(
                                1
                            ) // drop the initial state
                        } else {
                            emptyFlow()
                        }