Fix auto biometric prompt in background #554

This commit is contained in:
J-Jamet
2020-05-20 11:09:45 +02:00
parent 938343323d
commit 1cfc86e5ce
3 changed files with 9 additions and 5 deletions

View File

@@ -499,14 +499,12 @@ open class PasswordActivity : StylishActivity() {
override fun onPause() {
mProgressDialogThread?.unregisterProgressTask()
super.onPause()
}
override fun onDestroy() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
advancedUnlockedManager?.destroy()
advancedUnlockedManager = null
}
super.onDestroy()
super.onPause()
}
private fun verifyCheckboxesAndLoadDatabase(cipherDatabaseEntity: CipherDatabaseEntity? = null) {

View File

@@ -272,6 +272,8 @@ class AdvancedUnlockedManager(var context: FragmentActivity,
}
fun destroy() {
// Close the biometric prompt
biometricUnlockDatabaseHelper?.closeBiometricPrompt()
// Restore the checked listener
checkboxPasswordView?.setOnCheckedChangeListener(onCheckedPasswordChangeListener)
}

View File

@@ -271,6 +271,10 @@ class BiometricUnlockDatabaseHelper(private val context: FragmentActivity) {
}
}
fun closeBiometricPrompt() {
biometricPrompt?.cancelAuthentication()
}
interface BiometricUnlockErrorCallback {
fun onInvalidKeyException(e: Exception)
fun onBiometricException(e: Exception)