Loading packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -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?>> ) { Loading packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModelTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -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?>> ) { Loading
packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerMessageViewModel.kt +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading