diff options
3 files changed, 20 insertions, 1 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt index 069113b378da..163b35596c1b 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt @@ -511,7 +511,7 @@ private const val DOT_DIAMETER_DP = 14 private const val SELECTED_DOT_DIAMETER_DP = (DOT_DIAMETER_DP * 1.5).toInt() private const val SELECTED_DOT_REACTION_ANIMATION_DURATION_MS = 83 private const val SELECTED_DOT_RETRACT_ANIMATION_DURATION_MS = 750 -private const val LINE_STROKE_WIDTH_DP = DOT_DIAMETER_DP +private const val LINE_STROKE_WIDTH_DP = 22 private const val FAILURE_ANIMATION_DOT_DIAMETER_DP = (DOT_DIAMETER_DP * 0.81f).toInt() private const val FAILURE_ANIMATION_DOT_SHRINK_ANIMATION_DURATION_MS = 50 private const val FAILURE_ANIMATION_DOT_SHRINK_STAGGER_DELAY_MS = 33 diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt index b83ab7ef0c1b..c1615253804c 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt @@ -430,6 +430,22 @@ class BouncerMessageViewModelTest : SysuiTestCase() { .isEqualTo("Can’t unlock with face. Too many attempts.") } + @Test + fun startLockdownCountdown_onActivated() = + testScope.runTest { + val bouncerMessage by collectLastValue(underTest.message) + val lockoutSeconds = 200 * 1000 // 200 second lockout + kosmos.fakeAuthenticationRepository.setAuthenticationMethod(Pin) + kosmos.fakeAuthenticationRepository.reportLockoutStarted(lockoutSeconds) + runCurrent() + + assertThat(bouncerMessage?.text).isEqualTo("Try again in 200 seconds.") + advanceTimeBy(100.seconds) + assertThat(bouncerMessage?.text).isEqualTo("Try again in 100 seconds.") + advanceTimeBy(101.seconds) + assertThat(bouncerMessage?.text).isEqualTo("Enter PIN") + } + private fun TestScope.verifyMessagesForAuthFlags( vararg authFlagToMessagePair: Pair<Int, Pair<String, String?>> ) { diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt index d746220dd7ce..cfd4f506f169 100644 --- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt @@ -264,6 +264,9 @@ constructor( // Keeps the lockout message up-to-date. launch { bouncerInteractor.onLockoutStarted.collect { startLockoutCountdown() } } + // Start already active lockdown if it exists + launch { startLockoutCountdown() } + // Listens to relevant bouncer events launch { bouncerInteractor.onIncorrectBouncerInput |