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 d558371798
commit d18b529285
@@ -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
}