Ensure that remaining pin code attempts is never bigger than the value in the config.

This commit is contained in:
Benoit Marty 2026-05-06 12:08:33 +02:00 committed by Benoit Marty
parent 6ad8a63e36
commit ab48f761e1

View file

@ -82,5 +82,7 @@ class PreferencesLockScreenStore(
}
}
private fun Preferences.getRemainingPinCodeAttemptsNumber() = this[remainingAttemptsKey] ?: lockScreenConfig.maxPinCodeAttemptsBeforeLogout
private fun Preferences.getRemainingPinCodeAttemptsNumber() =
this[remainingAttemptsKey]?.coerceIn(0, lockScreenConfig.maxPinCodeAttemptsBeforeLogout)
?: lockScreenConfig.maxPinCodeAttemptsBeforeLogout
}