mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
UseNativeBiometric only for SDK 29
This commit is contained in:
parent
b13f5356fe
commit
9c08a37772
1 changed files with 3 additions and 8 deletions
|
@ -351,17 +351,12 @@ namespace Bit.Droid.Services
|
|||
|
||||
public async Task<bool> BiometricAvailableAsync()
|
||||
{
|
||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||
if((int)Build.VERSION.SdkInt >= 29)
|
||||
if(UseNativeBiometric())
|
||||
{
|
||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||
var manager = activity.GetSystemService(Context.BiometricService) as BiometricManager;
|
||||
return manager.CanAuthenticate() == BiometricCode.Success;
|
||||
}
|
||||
else if((int)Build.VERSION.SdkInt == 28)
|
||||
{
|
||||
var manager = activity.GetSystemService(Context.FingerprintService) as FingerprintManager;
|
||||
return manager.IsHardwareDetected && manager.HasEnrolledFingerprints;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
|
@ -377,7 +372,7 @@ namespace Bit.Droid.Services
|
|||
|
||||
public bool UseNativeBiometric()
|
||||
{
|
||||
return (int)Build.VERSION.SdkInt >= 28;
|
||||
return (int)Build.VERSION.SdkInt >= 29;
|
||||
}
|
||||
|
||||
public Task<bool> AuthenticateBiometricAsync(string text = null)
|
||||
|
|
Loading…
Reference in a new issue