chore: add more logging to biometric operations

This commit is contained in:
Harsh Shandilya 2023-03-08 22:59:31 +05:30
parent 16d6b1e853
commit d8dbe74d3a
No known key found for this signature in database

View file

@ -60,7 +60,7 @@ object BiometricAuthenticator {
object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
super.onAuthenticationError(errorCode, errString)
logcat(TAG) { "BiometricAuthentication error: errorCode=$errorCode, msg=$errString" }
logcat(TAG) { "onAuthenticationError(errorCode=$errorCode, msg=$errString)" }
callback(
when (errorCode) {
BiometricPrompt.ERROR_CANCELED,
@ -103,11 +103,13 @@ object BiometricAuthenticator {
override fun onAuthenticationFailed() {
super.onAuthenticationFailed()
logcat(TAG) { "onAuthenticationFailed()" }
callback(Result.Retry)
}
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
super.onAuthenticationSucceeded(result)
logcat(TAG) { "onAuthenticationSucceeded()" }
callback(Result.Success(result.cryptoObject))
}
}