From 695ba6826bb0f8a1837fc2b28f900bc00b56b2a3 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 21 Apr 2020 20:08:12 +0200 Subject: [PATCH] missing runOnUiThread --- .../androidaps/utils/protection/BiometricCheck.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt b/app/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt index e55d6e999e..2ab79f6b54 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/protection/BiometricCheck.kt @@ -5,6 +5,7 @@ import androidx.biometric.BiometricPrompt import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.R import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.androidaps.utils.extensions.runOnUiThread import java.util.concurrent.Executors object BiometricCheck { @@ -24,7 +25,9 @@ object BiometricCheck { BiometricConstants.ERROR_USER_CANCELED -> { ToastUtils.showToastInUiThread(activity.baseContext, errString.toString()) // fallback to master password - passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + runOnUiThread(Runnable { + passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + }) } BiometricConstants.ERROR_NEGATIVE_BUTTON -> @@ -34,7 +37,9 @@ object BiometricCheck { ToastUtils.showToastInUiThread(activity.baseContext, errString.toString()) // no pin set // fallback to master password - passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + runOnUiThread(Runnable { + passwordCheck.queryPassword(activity, R.string.master_password, R.string.key_master_password, { ok?.run() }, { cancel?.run() }, { fail?.run() }) + }) } BiometricConstants.ERROR_NO_SPACE,