mirror of
https://github.com/bitwarden/mobile
synced 2025-12-10 05:13:31 +00:00
Previously a call to BiometricPrompt.AuthenticationCallback#OnAuthenticationFailed() was treated as though an unrecoverable failure had occurred. However this is called on each failed fingerprint match, for example, and is not a terminal failure. Now these intermittent failures are ignored and a call to #OnAuthenticationError() is recognised as an unrecoverable failure instead.
This commit is contained in:
@@ -446,7 +446,8 @@ namespace Bit.Droid.Services
|
|||||||
new BiometricAuthenticationCallback
|
new BiometricAuthenticationCallback
|
||||||
{
|
{
|
||||||
Success = authResult => result.TrySetResult(true),
|
Success = authResult => result.TrySetResult(true),
|
||||||
Failed = () => result.TrySetResult(false),
|
Error = () => result.TrySetResult(false),
|
||||||
|
Failed = () => { },
|
||||||
Help = (helpCode, helpString) => { }
|
Help = (helpCode, helpString) => { }
|
||||||
});
|
});
|
||||||
return result.Task;
|
return result.Task;
|
||||||
@@ -866,6 +867,7 @@ namespace Bit.Droid.Services
|
|||||||
private class BiometricAuthenticationCallback : BiometricPrompt.AuthenticationCallback
|
private class BiometricAuthenticationCallback : BiometricPrompt.AuthenticationCallback
|
||||||
{
|
{
|
||||||
public Action<BiometricPrompt.AuthenticationResult> Success { get; set; }
|
public Action<BiometricPrompt.AuthenticationResult> Success { get; set; }
|
||||||
|
public Action Error { get; set; }
|
||||||
public Action Failed { get; set; }
|
public Action Failed { get; set; }
|
||||||
public Action<BiometricAcquiredStatus, Java.Lang.ICharSequence> Help { get; set; }
|
public Action<BiometricAcquiredStatus, Java.Lang.ICharSequence> Help { get; set; }
|
||||||
|
|
||||||
@@ -875,6 +877,12 @@ namespace Bit.Droid.Services
|
|||||||
Success?.Invoke(authResult);
|
Success?.Invoke(authResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnAuthenticationError([GeneratedEnum] BiometricErrorCode errorCode, Java.Lang.ICharSequence errString)
|
||||||
|
{
|
||||||
|
base.OnAuthenticationError(errorCode, errString);
|
||||||
|
Error?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnAuthenticationFailed()
|
public override void OnAuthenticationFailed()
|
||||||
{
|
{
|
||||||
base.OnAuthenticationFailed();
|
base.OnAuthenticationFailed();
|
||||||
|
|||||||
Reference in New Issue
Block a user