diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2023-05-08 01:10:45 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2023-05-08 01:10:45 +0530 |
commit | 136f4e5caa15320a4f569572424d77b96a406332 (patch) | |
tree | 81b4041463cc1f2d6aa633dae1bd95aa0a3f8494 /app/src/main/java | |
parent | cb6a92e1d3de938ac1cb807c7d01a10bedaca3f1 (diff) |
chore: touch up codestyle in `BiometricAuthenticator.kt`
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/app/passwordstore/util/auth/BiometricAuthenticator.kt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/java/app/passwordstore/util/auth/BiometricAuthenticator.kt b/app/src/main/java/app/passwordstore/util/auth/BiometricAuthenticator.kt index 777a4c91..ddc52ff2 100644 --- a/app/src/main/java/app/passwordstore/util/auth/BiometricAuthenticator.kt +++ b/app/src/main/java/app/passwordstore/util/auth/BiometricAuthenticator.kt @@ -18,7 +18,7 @@ import logcat.logcat object BiometricAuthenticator { private const val TAG = "BiometricAuthenticator" - private const val validAuthenticators = + private const val VALID_AUTHENTICATORS = Authenticators.DEVICE_CREDENTIAL or Authenticators.BIOMETRIC_WEAK /** @@ -47,7 +47,7 @@ object BiometricAuthenticator { } fun canAuthenticate(activity: FragmentActivity): Boolean { - return BiometricManager.from(activity).canAuthenticate(validAuthenticators) == + return BiometricManager.from(activity).canAuthenticate(VALID_AUTHENTICATORS) == BiometricManager.BIOMETRIC_SUCCESS } @@ -88,9 +88,7 @@ object BiometricAuthenticator { Result.Retry } // We cover all guaranteed values above, but [errorCode] is still an Int - // at the end of - // the day so a - // catch-all else will always be required. + // at the end of the day so a catch-all else will always be required. else -> { Result.Failure( errorCode, @@ -118,7 +116,7 @@ object BiometricAuthenticator { val promptInfo = BiometricPrompt.PromptInfo.Builder() .setTitle(activity.getString(dialogTitleRes)) - .setAllowedAuthenticators(validAuthenticators) + .setAllowedAuthenticators(VALID_AUTHENTICATORS) .build() BiometricPrompt( activity, |