mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
remove biometrics confirmation when toggling on/off the setting
yeah i tried a face unlock can you tell?
This commit is contained in:
parent
cea490be3a
commit
0b37080e47
3 changed files with 5 additions and 0 deletions
|
@ -202,6 +202,7 @@ fun SwitchPreferenceCompat.requireAuthentication(
|
|||
activity: FragmentActivity?,
|
||||
title: String,
|
||||
subtitle: String? = null,
|
||||
confirmationRequired: Boolean = true,
|
||||
) {
|
||||
onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue ->
|
||||
newValue as Boolean
|
||||
|
@ -209,6 +210,7 @@ fun SwitchPreferenceCompat.requireAuthentication(
|
|||
activity.startAuthentication(
|
||||
title,
|
||||
subtitle,
|
||||
confirmationRequired,
|
||||
callback = object : AuthenticatorUtil.AuthenticationCallback() {
|
||||
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
|
||||
super.onAuthenticationSucceeded(result)
|
||||
|
|
|
@ -22,6 +22,7 @@ class SettingsSecurityController : SettingsController() {
|
|||
requireAuthentication(
|
||||
activity as? FragmentActivity,
|
||||
context.getString(R.string.lock_with_biometrics),
|
||||
confirmationRequired = false,
|
||||
)
|
||||
}
|
||||
intListPreference(activity) {
|
||||
|
|
|
@ -27,6 +27,7 @@ object AuthenticatorUtil {
|
|||
fun FragmentActivity.startAuthentication(
|
||||
title: String,
|
||||
subtitle: String? = null,
|
||||
confirmationRequired: Boolean = true,
|
||||
callback: AuthenticationCallback,
|
||||
) {
|
||||
isAuthenticating = true
|
||||
|
@ -41,6 +42,7 @@ object AuthenticatorUtil {
|
|||
.setTitle(title)
|
||||
.setSubtitle(subtitle)
|
||||
.setAllowedAuthenticators(BiometricManager.Authenticators.DEVICE_CREDENTIAL or BiometricManager.Authenticators.BIOMETRIC_WEAK)
|
||||
.setConfirmationRequired(confirmationRequired)
|
||||
.build()
|
||||
|
||||
biometricPrompt.authenticate(promptInfo)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue