From 44d27333a741d04ccc2093ff77c8008a80ba9911 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sun, 21 Mar 2021 09:44:37 +0100 Subject: Do not cancel keygen biometric prompt on failure (#1357) Biometric authentication may very well fail a few times due to e.g. using the wrong finger, but that should not cancel the key generation flow. The BiometricAuthenticator UI gracefully handles the error case for us with an informative message. Co-authored-by: Harsh Shandilya --- .../main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt index c2025538..ae420813 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/sshkeygen/SshKeyGenActivity.kt @@ -109,7 +109,10 @@ class SshKeyGenActivity : AppCompatActivity() { BiometricAuthenticator.authenticate( this@SshKeyGenActivity, R.string.biometric_prompt_title_ssh_keygen - ) { cont.resume(it) } + ) { + // Do not cancel on failed attempts as these are handled by the authenticator UI. + if (it !is BiometricAuthenticator.Result.Failure) cont.resume(it) + } } } if (result !is BiometricAuthenticator.Result.Success) -- cgit v1.2.3