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

Commit e4726ac6 authored by Chandru S's avatar Chandru S
Browse files

Show unlock with fingerprint message for co-ex face locked out scenario

Bug: 236891644
Test: verified manually
Change-Id: I59e48540214b6c2a1ff3b43acf5b5213e163e18e
parent c1ea19c0
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -131,7 +131,9 @@ constructor(
            PROMPT_REASON_AFTER_LOCKOUT -> biometricLockout(securityMode)
            PROMPT_REASON_PREPARE_FOR_UPDATE -> authRequiredForUnattendedUpdate(securityMode)
            PROMPT_REASON_FINGERPRINT_LOCKED_OUT -> fingerprintUnlockUnavailable(securityMode)
            PROMPT_REASON_FACE_LOCKED_OUT -> faceUnlockUnavailable(securityMode)
            PROMPT_REASON_FACE_LOCKED_OUT ->
                if (fpAllowedInBouncer) faceLockedOutButFingerprintAvailable(securityMode)
                else faceLockedOut(securityMode)
            PROMPT_REASON_INCORRECT_PRIMARY_AUTH_INPUT ->
                if (fpAllowedInBouncer) incorrectSecurityInputWithFingerprint(securityMode)
                else incorrectSecurityInput(securityMode)
@@ -311,7 +313,7 @@ private fun nonStrongAuthTimeoutWithFingerprintAllowed(securityMode: SecurityMod
    }
}

private fun faceUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> {
private fun faceLockedOut(securityMode: SecurityMode): Pair<Int, Int> {
    return when (securityMode) {
        SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_face_locked_out)
        SecurityMode.Password -> Pair(keyguard_enter_password, kg_face_locked_out)
@@ -320,6 +322,15 @@ private fun faceUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> {
    }
}

private fun faceLockedOutButFingerprintAvailable(securityMode: SecurityMode): Pair<Int, Int> {
    return when (securityMode) {
        SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, kg_face_locked_out)
        SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, kg_face_locked_out)
        SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, kg_face_locked_out)
        else -> Pair(0, 0)
    }
}

private fun fingerprintUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> {
    return when (securityMode) {
        SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_fp_locked_out)