From 9c08a3777243cb35f0f4ca2a749096f3c9c0d4a1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 23 Oct 2019 11:54:53 -0400 Subject: [PATCH] UseNativeBiometric only for SDK 29 --- src/Android/Services/DeviceActionService.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 7975dde31..38dee93f2 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -351,17 +351,12 @@ namespace Bit.Droid.Services public async Task 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 AuthenticateBiometricAsync(string text = null)