Move BiometricUtil to correct package

This commit is contained in:
arkon
2021-04-03 11:38:01 -04:00
parent 68600b337e
commit 1237af1ff3
4 changed files with 4 additions and 4 deletions

View File

@@ -1,26 +0,0 @@
package eu.kanade.tachiyomi.widget
import android.content.Context
import androidx.biometric.BiometricManager
import androidx.biometric.BiometricManager.Authenticators
object BiometricUtil {
fun getSupportedAuthenticators(context: Context): Int {
return listOf(
Authenticators.BIOMETRIC_STRONG,
Authenticators.BIOMETRIC_WEAK,
Authenticators.DEVICE_CREDENTIAL,
)
.filter { BiometricManager.from(context).canAuthenticate(it) == BiometricManager.BIOMETRIC_SUCCESS }
.fold(0) { acc, auth -> acc or auth }
}
fun isSupported(context: Context): Boolean {
return getSupportedAuthenticators(context) != 0
}
fun isDeviceCredentialAllowed(context: Context): Boolean {
return getSupportedAuthenticators(context) and Authenticators.DEVICE_CREDENTIAL != 0
}
}