Merge pull request #65 from PhilKes/fix/failed-lock-exit

Finish LockedActivity for any authentication error
This commit is contained in:
Phil 2024-10-27 11:18:31 +01:00 committed by GitHub
commit 33e99d6058
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View file

@ -49,9 +49,13 @@ abstract class LockedActivity<T : ViewBinding> : AppCompatActivity() {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
if (requestCode == REQUEST_BIOMETRIC_AUTHENTICATION && resultCode == Activity.RESULT_OK) { if (requestCode == REQUEST_BIOMETRIC_AUTHENTICATION) {
notallyXApplication.isLocked = false if (resultCode == Activity.RESULT_OK) {
show() notallyXApplication.isLocked = false
show()
} else {
finish()
}
} }
} }

View file

@ -108,6 +108,11 @@ private fun showBiometricOrPinPrompt(
super.onAuthenticationFailed() super.onAuthenticationFailed()
onFailure.invoke() onFailure.invoke()
} }
override fun onAuthenticationError(errorCode: Int, errString: CharSequence?) {
super.onAuthenticationError(errorCode, errString)
onFailure.invoke()
}
}, },
) )
} }
@ -140,6 +145,14 @@ private fun showBiometricOrPinPrompt(
super.onAuthenticationFailed() super.onAuthenticationFailed()
onFailure.invoke() onFailure.invoke()
} }
override fun onAuthenticationError(
errorCode: Int,
errString: CharSequence?,
) {
super.onAuthenticationError(errorCode, errString)
onFailure.invoke()
}
}, },
null, null,
) )