mirror of
https://github.com/PhilKes/NotallyX.git
synced 2025-06-28 12:19:55 +00:00
Merge pull request #65 from PhilKes/fix/failed-lock-exit
Finish LockedActivity for any authentication error
This commit is contained in:
commit
33e99d6058
2 changed files with 20 additions and 3 deletions
|
@ -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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue