diff options
2 files changed, 8 insertions, 17 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt index cb8cebf80767..81878aaf4a18 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractorTest.kt @@ -179,10 +179,14 @@ class AuthenticationInteractorTest : SysuiTestCase() { setAutoConfirmFeatureEnabled(true) } assertThat(isAutoConfirmEnabled).isTrue() - val shorterPin = - FakeAuthenticationRepository.DEFAULT_PIN.toMutableList().apply { removeLast() } + val defaultPin = FakeAuthenticationRepository.DEFAULT_PIN.toMutableList() - assertSkipped(underTest.authenticate(shorterPin, tryAutoConfirm = true)) + assertSkipped( + underTest.authenticate( + defaultPin.subList(0, defaultPin.size - 1), + tryAutoConfirm = true + ) + ) assertThat(underTest.lockoutEndTimestamp).isNull() assertThat(kosmos.fakeAuthenticationRepository.lockoutStartedReportCount).isEqualTo(0) } @@ -201,7 +205,6 @@ class AuthenticationInteractorTest : SysuiTestCase() { assertFailed( underTest.authenticate(wrongPin, tryAutoConfirm = true), - assertNoResultEvents = true, ) } @@ -219,7 +222,6 @@ class AuthenticationInteractorTest : SysuiTestCase() { assertFailed( underTest.authenticate(longerPin, tryAutoConfirm = true), - assertNoResultEvents = true, ) } @@ -547,14 +549,9 @@ class AuthenticationInteractorTest : SysuiTestCase() { private fun assertFailed( authenticationResult: AuthenticationResult, - assertNoResultEvents: Boolean = false, ) { assertThat(authenticationResult).isEqualTo(AuthenticationResult.FAILED) - if (assertNoResultEvents) { - assertThat(onAuthenticationResult).isNull() - } else { - assertThat(onAuthenticationResult).isFalse() - } + assertThat(onAuthenticationResult).isFalse() } private fun assertSkipped( diff --git a/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt b/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt index 8ca083fa1e35..5df7fc9865ff 100644 --- a/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt @@ -243,12 +243,6 @@ constructor( } // Authentication failed. - - if (tryAutoConfirm) { - // Auto-confirm is active, the failed attempt should have no side-effects. - return AuthenticationResult.FAILED - } - repository.reportAuthenticationAttempt(isSuccessful = false) if (authenticationResult.lockoutDurationMs > 0) { |