mirror of
https://github.com/bitwarden/android.git
synced 2025-01-12 11:17:30 +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()
|
public async Task<bool> BiometricAvailableAsync()
|
||||||
{
|
{
|
||||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
if(UseNativeBiometric())
|
||||||
if((int)Build.VERSION.SdkInt >= 29)
|
|
||||||
{
|
{
|
||||||
|
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||||
var manager = activity.GetSystemService(Context.BiometricService) as BiometricManager;
|
var manager = activity.GetSystemService(Context.BiometricService) as BiometricManager;
|
||||||
return manager.CanAuthenticate() == BiometricCode.Success;
|
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
|
else
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -377,7 +372,7 @@ namespace Bit.Droid.Services
|
||||||
|
|
||||||
public bool UseNativeBiometric()
|
public bool UseNativeBiometric()
|
||||||
{
|
{
|
||||||
return (int)Build.VERSION.SdkInt >= 28;
|
return (int)Build.VERSION.SdkInt >= 29;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<bool> AuthenticateBiometricAsync(string text = null)
|
public Task<bool> AuthenticateBiometricAsync(string text = null)
|
||||||
|
|
Loading…
Reference in a new issue