Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae289f5c authored by Chandru S's avatar Chandru S Committed by Android (Google) Code Review
Browse files

Merge changes Id3cb4d04,I3cf427b3 into main

* changes:
  Change pattern line thickness to match the bouncer spec
  Restart any pending bouncer lockout when device boots up.
parents 6990f576 eb08f76c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+16 −0
Original line number Diff line number Diff line
@@ -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?>>
    ) {
+3 −0
Original line number Diff line number Diff line
@@ -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