mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-26 12:16:07 +01:00
FingerprintManager to detect fingerprints on SDK 28
This commit is contained in:
parent
5f0c9725ce
commit
b13f5356fe
@ -9,6 +9,7 @@ using Android.App.Assist;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.Hardware.Biometrics;
|
||||
using Android.Hardware.Fingerprints;
|
||||
using Android.Nfc;
|
||||
using Android.OS;
|
||||
using Android.Provider;
|
||||
@ -350,12 +351,17 @@ namespace Bit.Droid.Services
|
||||
|
||||
public async Task<bool> BiometricAvailableAsync()
|
||||
{
|
||||
if(UseNativeBiometric())
|
||||
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
|
||||
if((int)Build.VERSION.SdkInt >= 29)
|
||||
{
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user