aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2024-07-30 17:19:44 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2024-07-30 17:19:56 +0530
commit81be3988c83ad9f29ec043cfd6f1b7559407b0f2 (patch)
treef103e471ee5bd67b69f1878cc59209e7bf18d6d2 /app/src/main/java
parentf1cb72a1f6adf330545328947629ff88a566c343 (diff)
fix: re-enable biometric lock feature
Fixes #2802
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt15
1 files changed, 9 insertions, 6 deletions
diff --git a/app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt b/app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt
index 6044b5a8..4e42bda8 100644
--- a/app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt
+++ b/app/src/main/java/app/passwordstore/ui/settings/GeneralSettings.kt
@@ -6,6 +6,7 @@
package app.passwordstore.ui.settings
import android.content.pm.ShortcutManager
+import android.os.Build
import androidx.core.content.edit
import androidx.core.content.getSystemService
import androidx.fragment.app.FragmentActivity
@@ -65,15 +66,17 @@ class GeneralSettings(private val activity: FragmentActivity) : SettingsProvider
defaultValue = false
}
- // val canAuthenticate = BiometricAuthenticator.canAuthenticate(activity)
+ // See https://github.com/android-password-store/Android-Password-Store/issues/2802
+ val disableAuth = Build.VERSION.SDK_INT == Build.VERSION_CODES.UPSIDE_DOWN_CAKE
+ val canAuthenticate = BiometricAuthenticator.canAuthenticate(activity)
switch(PreferenceKeys.BIOMETRIC_AUTH_2) {
titleRes = R.string.pref_biometric_auth_title
defaultValue = false
- enabled = false
- // summaryRes =
- // if (canAuthenticate) R.string.pref_biometric_auth_summary
- // else R.string.pref_biometric_auth_summary_error
- summary = "Temporarily disabled due to a bug, see issue 2802"
+ enabled = !disableAuth
+ summaryRes =
+ if (disableAuth) R.string.pref_biometric_auth_summary_disabled_platform
+ else if (canAuthenticate) R.string.pref_biometric_auth_summary
+ else R.string.pref_biometric_auth_summary_error
onClick {
enabled = false
val isChecked = checked