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

View File

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