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

Commit af376971 authored by Grace Cheng's avatar Grace Cheng
Browse files

Separates SFPS and UDFPS BP animation logic

Fixes issue with UDFPS animation playing on transition from STATE_IDLE

Test: Tested BP on rear-FPS, SFPS, UDFPS devices to check animations
Fixes: 266367594
Change-Id: I8ed3371519fe3b2419c32829036bbb0c530e48e1
parent c52342b1
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ open class AuthBiometricFingerprintIconController(

        iconView.frame = 0
        iconViewOverlay.frame = 0
        if (shouldAnimateIconViewForTransition(lastState, newState)) {
        if (shouldAnimateSfpsIconViewForTransition(lastState, newState)) {
            iconView.playAnimation()
        }

@@ -165,6 +165,18 @@ open class AuthBiometricFingerprintIconController(
    protected open fun shouldAnimateIconViewForTransition(
            @BiometricState oldState: Int,
            @BiometricState newState: Int
    ) = when (newState) {
        STATE_HELP,
        STATE_ERROR -> true
        STATE_AUTHENTICATING_ANIMATING_IN,
        STATE_AUTHENTICATING -> oldState == STATE_ERROR || oldState == STATE_HELP
        STATE_AUTHENTICATED -> true
        else -> false
    }

    private fun shouldAnimateSfpsIconViewForTransition(
            @BiometricState oldState: Int,
            @BiometricState newState: Int
    ) = when (newState) {
        STATE_HELP,
        STATE_ERROR -> true