Skip to content

Commit

Permalink
refactor: renamed member so that it doesn't have the name of its class
Browse files Browse the repository at this point in the history
  • Loading branch information
JuancaG05 committed Jan 10, 2025
1 parent 8c27d1f commit b4dd448
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object BiometricManager {
mutableSetOf(BiometricActivity::class.java, PassCodeActivity::class.java, PatternActivity::class.java)
private val visibleActivities: MutableSet<Class<*>> = mutableSetOf()
private val preferencesProvider = OCSharedPreferencesProvider(appContext)
private val biometricManager: BiometricManager = BiometricManager.from(appContext)
private val androidBiometricManager: BiometricManager = BiometricManager.from(appContext)

fun onActivityStarted(activity: Activity) {
if (!exemptOfBiometricActivities.contains(activity.javaClass) && biometricShouldBeRequested()) {
Expand Down Expand Up @@ -96,9 +96,9 @@ object BiometricManager {
preferencesProvider.getBoolean(BiometricActivity.PREFERENCE_SET_BIOMETRIC, false)

fun isHardwareDetected(): Boolean =
biometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE &&
biometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE
androidBiometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_HW_UNAVAILABLE &&
androidBiometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_NO_HARDWARE

fun hasEnrolledBiometric(): Boolean =
biometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED
androidBiometricManager.canAuthenticate(BIOMETRIC_WEAK) != BiometricManager.BIOMETRIC_ERROR_NONE_ENROLLED
}

0 comments on commit b4dd448

Please sign in to comment.