Show toast on invalid key exception

This commit is contained in:
J-Jamet committed 2020-03-21 12:16:45 +01:00
1 parent 3fb1f18c22
commit c316011fbc
1 file changed
+9 -3
@@ -248,13 +248,19 @@ class NestedAppSettingsFragment : NestedSettingsFragment() {
BiometricUnlockDatabaseHelper.deleteEntryKeyInKeystoreForBiometric(
activity,
object : BiometricUnlockDatabaseHelper.BiometricUnlockErrorCallback {
override fun onInvalidKeyException(e: Exception) {}
override fun onBiometricException(e: Exception) {
fun showException(e: Exception) {
Toast.makeText(context,
getString(R.string.biometric_scanning_error, e.localizedMessage),
Toast.LENGTH_SHORT).show()
}
override fun onInvalidKeyException(e: Exception) {
showException(e)
}
override fun onBiometricException(e: Exception) {
showException(e)
}
})
}
CipherDatabaseAction.getInstance(context.applicationContext).deleteAll()