mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
suBiometric: fix open app on second user will auto disable biometric
second user does not support biometric, but the config of app ignores user
This commit is contained in:
parent
9571b6f9be
commit
ab9ee449e4
@ -18,14 +18,7 @@ class BiometricHelper(context: Context) {
|
||||
else -> false
|
||||
}
|
||||
|
||||
val isEnabled: Boolean get() {
|
||||
val enabled = Config.suBiometric
|
||||
if (enabled && !isSupported) {
|
||||
Config.suBiometric = false
|
||||
return false
|
||||
}
|
||||
return enabled
|
||||
}
|
||||
val isEnabled get() = isSupported && Config.suBiometric
|
||||
|
||||
fun authenticate(
|
||||
activity: FragmentActivity,
|
||||
|
@ -286,14 +286,16 @@ object Tapjack : BaseSettingsItem.Toggle() {
|
||||
object Biometrics : BaseSettingsItem.Toggle() {
|
||||
override val title = R.string.settings_su_biometric_title.asText()
|
||||
override var description = R.string.settings_su_biometric_summary.asText()
|
||||
override var value by Config::suBiometric
|
||||
override var value
|
||||
get() = ServiceLocator.biometrics.isEnabled
|
||||
set(value) {
|
||||
Config.suBiometric = value
|
||||
}
|
||||
|
||||
override fun refresh() {
|
||||
isEnabled = ServiceLocator.biometrics.isSupported
|
||||
if (!isEnabled) {
|
||||
value = false
|
||||
description = R.string.no_biometric.asText()
|
||||
notifyPropertyChanged(BR.checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user