mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-23 11:45:38 +01:00
UseNativeBiometric only for SDK 29
This commit is contained in:
parent
b13f5356fe
commit
9c08a37772
@ -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 New Issue
Block a user