diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-08 02:06:14 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-09-08 02:06:14 -0700 |
commit | 5f397d2b8f699dd1bf8c08c3951e864d3ac14304 (patch) | |
tree | 66d81d42186f4a60911332983542f392efe7eb42 /app/src/main/kotlin/com/pitchedapps/frost/utils | |
parent | f8b477b976cf858e1fff5dbb8f9de26ef3de1cd4 (diff) | |
download | frost-5f397d2b8f699dd1bf8c08c3951e864d3ac14304.tar.gz frost-5f397d2b8f699dd1bf8c08c3951e864d3ac14304.tar.bz2 frost-5f397d2b8f699dd1bf8c08c3951e864d3ac14304.zip |
Move biometric init out of coroutine launch
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/BiometricUtils.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/BiometricUtils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/BiometricUtils.kt index 4ececc8b..136fe28f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/BiometricUtils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/BiometricUtils.kt @@ -65,6 +65,11 @@ object BiometricUtils { return Prefs.biometricsEnabled && System.currentTimeMillis() - lastUnlockTime > UNLOCK_TIME_INTERVAL } + /** + * Generates a prompt dialog and attempt to return an auth object. + * Note that the underlying request will call [androidx.fragment.app.FragmentTransaction.commit], + * so this cannot happen after onSaveInstanceState. + */ fun authenticate(activity: FragmentActivity, force: Boolean = false): BiometricDeferred { val deferred: BiometricDeferred = CompletableDeferred() if (!force && !shouldPrompt(activity)) { |