using System.Threading.Tasks; using Bit.Core.Abstractions; namespace Bit.App.Services { public abstract class BaseBiometricService : IBiometricService { protected readonly IStateService _stateService; protected readonly ICryptoService _cryptoService; protected BaseBiometricService(IStateService stateService, ICryptoService cryptoService) { _stateService = stateService; _cryptoService = cryptoService; } public async Task CanUseBiometricsUnlockAsync() { return await _cryptoService.GetBiometricUnlockKeyAsync() != null || await _stateService.GetKeyEncryptedAsync() != null; } public abstract Task IsSystemBiometricIntegrityValidAsync(string bioIntegritySrcKey = null); public abstract Task SetupBiometricAsync(string bioIntegritySrcKey = null); } }