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

Commit e62f4bcf authored by Beverly's avatar Beverly Committed by Android Build Coastguard Worker
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
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0c969e275208394f77230041097861f5f3c84468)
Merged-In: Idb1c077e993345bf04d38ebee7615cf5429e25f8
Change-Id: Idb1c077e993345bf04d38ebee7615cf5429e25f8
parent 8fa0f212
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -90,7 +90,11 @@ class FromAlternateBouncerTransitionInteractorTest : SysuiTestCase() {
            )
            )
            reset(transitionRepository)
            reset(transitionRepository)


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

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