Allow linking of devices if no passlock is set.

This commit is contained in:
mtang-signal
2024-09-04 12:12:33 -07:00
committed by Cody Henthorne
parent 93c8cd133d
commit ba2d5bce41
3 changed files with 6 additions and 5 deletions

View File

@@ -35,8 +35,9 @@ class BiometricDeviceAuthentication(
private val DISALLOWED_BIOMETRIC_VERSIONS = setOf(28, 29)
}
fun canAuthenticate(): Boolean {
return biometricManager.canAuthenticate(ALLOWED_AUTHENTICATORS) == BiometricManager.BIOMETRIC_SUCCESS
fun canAuthenticate(context: Context): Boolean {
val isKeyGuardSecure = ServiceUtil.getKeyguardManager(context).isKeyguardSecure
return isKeyGuardSecure && biometricManager.canAuthenticate(ALLOWED_AUTHENTICATORS) == BiometricManager.BIOMETRIC_SUCCESS
}
fun authenticate(context: Context, force: Boolean, showConfirmDeviceCredentialIntent: () -> Unit): Boolean {