Loading packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt +8 −7 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { private lateinit var resources: TestableResources private lateinit var trustRepository: FakeTrustRepository private lateinit var testScope: TestScope private val TEST_REASON = "reason" @Before fun setUp() { Loading Loading @@ -118,7 +119,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { mainHandler.setMode(FakeHandler.Mode.QUEUEING) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // WHEN all queued messages are dispatched mainHandler.dispatchQueuedMessages() Loading @@ -134,7 +135,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { @Test fun testShow_isScrimmed() { underTest.show(true) underTest.show(true, TEST_REASON) verify(repository).setKeyguardAuthenticatedBiometrics(null) verify(repository).setPrimaryStartingToHide(false) verify(repository).setPrimaryScrimmed(true) Loading Loading @@ -162,7 +163,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { @Test fun testShowReturnsFalseWhenDelegateIsNotSet() { whenever(bouncerView.delegate).thenReturn(null) assertThat(underTest.show(true)).isEqualTo(false) assertThat(underTest.show(true, TEST_REASON)).isEqualTo(false) } @Test Loading @@ -171,7 +172,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(keyguardSecurityModel.getSecurityMode(anyInt())) .thenReturn(KeyguardSecurityModel.SecurityMode.SimPuk) underTest.show(true) underTest.show(true, TEST_REASON) verify(repository).setPrimaryShow(false) verify(repository).setPrimaryShow(true) } Loading Loading @@ -352,7 +353,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(faceAuthInteractor.canFaceAuthRun()).thenReturn(true) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon aren't updated immediately verify(repository, never()).setPrimaryShow(true) Loading @@ -375,7 +376,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(faceAuthInteractor.canFaceAuthRun()).thenReturn(false) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon are updated immediately verify(repository).setPrimaryShow(true) Loading @@ -394,7 +395,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { runCurrent() // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon were scheduled to update verify(repository, never()).setPrimaryShow(true) Loading packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractorTest.kt +20 −4 Original line number Diff line number Diff line Loading @@ -267,12 +267,20 @@ class KeyguardKeyEventInteractorTest : SysuiTestCase() { // action down: does NOT collapse the shade val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode) assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) // action up: collapses the shade val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode) assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isTrue() verify(statusBarKeyguardViewManager).showPrimaryBouncer(eq(true)) verify(statusBarKeyguardViewManager) .showPrimaryBouncer( eq(true), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) } private fun verifyActionsDoNothing(keycode: Int) { Loading @@ -280,12 +288,20 @@ class KeyguardKeyEventInteractorTest : SysuiTestCase() { val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode) assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse() verify(shadeController, never()).animateCollapseShadeForced() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) // action up: doesNothing val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode) assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isFalse() verify(shadeController, never()).animateCollapseShadeForced() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerViewModelTest.kt +7 −5 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.statusbar.phone.statusBarKeyguardViewManager import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.google.common.collect.Range import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest Loading @@ -56,7 +57,8 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { fun onTapped() = testScope.runTest { underTest.onTapped() verify(statusBarKeyguardViewManager).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager) .showPrimaryBouncer(any(), eq("AlternateBouncerViewModel#onTapped")) } @Test Loading Loading @@ -154,7 +156,7 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { private fun stepToAlternateBouncer( value: Float, state: TransitionState = TransitionState.RUNNING state: TransitionState = TransitionState.RUNNING, ): TransitionStep { return step( from = KeyguardState.LOCKSCREEN, Loading @@ -166,7 +168,7 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { private fun stepFromAlternateBouncer( value: Float, state: TransitionState = TransitionState.RUNNING state: TransitionState = TransitionState.RUNNING, ): TransitionStep { return step( from = KeyguardState.ALTERNATE_BOUNCER, Loading @@ -180,14 +182,14 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { from: KeyguardState, to: KeyguardState, value: Float, transitionState: TransitionState transitionState: TransitionState, ): TransitionStep { return TransitionStep( from = from, to = to, value = value, transitionState = transitionState, ownerName = "AlternateBouncerViewModelTest" ownerName = "AlternateBouncerViewModelTest", ) } } packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +24 −12 Original line number Diff line number Diff line Loading @@ -186,7 +186,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { .thenReturn(false); mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); verify(mStatusBarKeyguardViewManager, never()).notifyKeyguardAuthenticated(anyBoolean()); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); Loading @@ -198,7 +199,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { .thenReturn(false); mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, false /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); assertThat(mBiometricUnlockController.getBiometricType()) Loading Loading @@ -248,7 +250,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING); Loading Loading @@ -327,7 +330,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); } Loading Loading @@ -359,7 +363,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_NONE); } Loading Loading @@ -438,17 +443,20 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { // WHEN udfps fails once - then don't show the bouncer yet mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN udfps fails the second time - then don't show the bouncer yet mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN udpfs fails the third time mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); // THEN show the bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true, "BiometricUnlockController#MODE_SHOW_BOUNCER"); } @Test Loading @@ -460,14 +468,16 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN lockout is received mBiometricUnlockController.onBiometricError(FingerprintManager.FINGERPRINT_ERROR_LOCKOUT, "Lockout", BiometricSourceType.FINGERPRINT); // THEN show bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true, "BiometricUnlockController#MODE_SHOW_BOUNCER"); } @Test Loading Loading @@ -544,7 +554,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); // THEN shows primary bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); } @Test Loading @@ -554,7 +565,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { BiometricSourceType.FACE, false /* isStrongBiometric */); // THEN shows primary bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); } private void givenFingerprintModeUnlockCollapsing() { Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,8 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase { mRemoteInputCallback.onLockedRemoteInput( mock(ExpandableNotificationRow.class), mock(View.class)); verify(mStatusBarKeyguardViewManager).showBouncer(true); verify(mStatusBarKeyguardViewManager).showBouncer(true, "StatusBarRemoteInputCallback#onLockedRemoteInput"); } @Test @DisableFlags(ExpandHeadsUpOnInlineReply.FLAG_NAME) Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt +8 −7 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { private lateinit var resources: TestableResources private lateinit var trustRepository: FakeTrustRepository private lateinit var testScope: TestScope private val TEST_REASON = "reason" @Before fun setUp() { Loading Loading @@ -118,7 +119,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { mainHandler.setMode(FakeHandler.Mode.QUEUEING) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // WHEN all queued messages are dispatched mainHandler.dispatchQueuedMessages() Loading @@ -134,7 +135,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { @Test fun testShow_isScrimmed() { underTest.show(true) underTest.show(true, TEST_REASON) verify(repository).setKeyguardAuthenticatedBiometrics(null) verify(repository).setPrimaryStartingToHide(false) verify(repository).setPrimaryScrimmed(true) Loading Loading @@ -162,7 +163,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { @Test fun testShowReturnsFalseWhenDelegateIsNotSet() { whenever(bouncerView.delegate).thenReturn(null) assertThat(underTest.show(true)).isEqualTo(false) assertThat(underTest.show(true, TEST_REASON)).isEqualTo(false) } @Test Loading @@ -171,7 +172,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(keyguardSecurityModel.getSecurityMode(anyInt())) .thenReturn(KeyguardSecurityModel.SecurityMode.SimPuk) underTest.show(true) underTest.show(true, TEST_REASON) verify(repository).setPrimaryShow(false) verify(repository).setPrimaryShow(true) } Loading Loading @@ -352,7 +353,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(faceAuthInteractor.canFaceAuthRun()).thenReturn(true) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon aren't updated immediately verify(repository, never()).setPrimaryShow(true) Loading @@ -375,7 +376,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { whenever(faceAuthInteractor.canFaceAuthRun()).thenReturn(false) // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon are updated immediately verify(repository).setPrimaryShow(true) Loading @@ -394,7 +395,7 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { runCurrent() // WHEN bouncer show is requested underTest.show(true) underTest.show(true, TEST_REASON) // THEN primary show & primary showing soon were scheduled to update verify(repository, never()).setPrimaryShow(true) Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardKeyEventInteractorTest.kt +20 −4 Original line number Diff line number Diff line Loading @@ -267,12 +267,20 @@ class KeyguardKeyEventInteractorTest : SysuiTestCase() { // action down: does NOT collapse the shade val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode) assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) // action up: collapses the shade val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode) assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isTrue() verify(statusBarKeyguardViewManager).showPrimaryBouncer(eq(true)) verify(statusBarKeyguardViewManager) .showPrimaryBouncer( eq(true), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) } private fun verifyActionsDoNothing(keycode: Int) { Loading @@ -280,12 +288,20 @@ class KeyguardKeyEventInteractorTest : SysuiTestCase() { val actionDownMenuKeyEvent = KeyEvent(KeyEvent.ACTION_DOWN, keycode) assertThat(underTest.dispatchKeyEvent(actionDownMenuKeyEvent)).isFalse() verify(shadeController, never()).animateCollapseShadeForced() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) // action up: doesNothing val actionUpMenuKeyEvent = KeyEvent(KeyEvent.ACTION_UP, keycode) assertThat(underTest.dispatchKeyEvent(actionUpMenuKeyEvent)).isFalse() verify(shadeController, never()).animateCollapseShadeForced() verify(statusBarKeyguardViewManager, never()).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager, never()) .showPrimaryBouncer( any(), eq("KeyguardKeyEventInteractor#collapseShadeLockedOrShowPrimaryBouncer"), ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/AlternateBouncerViewModelTest.kt +7 −5 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.statusbar.phone.statusBarKeyguardViewManager import com.android.systemui.testKosmos import com.android.systemui.util.mockito.any import com.android.systemui.util.mockito.eq import com.google.common.collect.Range import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.test.runTest Loading @@ -56,7 +57,8 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { fun onTapped() = testScope.runTest { underTest.onTapped() verify(statusBarKeyguardViewManager).showPrimaryBouncer(any()) verify(statusBarKeyguardViewManager) .showPrimaryBouncer(any(), eq("AlternateBouncerViewModel#onTapped")) } @Test Loading Loading @@ -154,7 +156,7 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { private fun stepToAlternateBouncer( value: Float, state: TransitionState = TransitionState.RUNNING state: TransitionState = TransitionState.RUNNING, ): TransitionStep { return step( from = KeyguardState.LOCKSCREEN, Loading @@ -166,7 +168,7 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { private fun stepFromAlternateBouncer( value: Float, state: TransitionState = TransitionState.RUNNING state: TransitionState = TransitionState.RUNNING, ): TransitionStep { return step( from = KeyguardState.ALTERNATE_BOUNCER, Loading @@ -180,14 +182,14 @@ class AlternateBouncerViewModelTest : SysuiTestCase() { from: KeyguardState, to: KeyguardState, value: Float, transitionState: TransitionState transitionState: TransitionState, ): TransitionStep { return TransitionStep( from = from, to = to, value = value, transitionState = transitionState, ownerName = "AlternateBouncerViewModelTest" ownerName = "AlternateBouncerViewModelTest", ) } }
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java +24 −12 Original line number Diff line number Diff line Loading @@ -186,7 +186,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { .thenReturn(false); mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); verify(mStatusBarKeyguardViewManager, never()).notifyKeyguardAuthenticated(anyBoolean()); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); Loading @@ -198,7 +199,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { .thenReturn(false); mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, false /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); assertThat(mBiometricUnlockController.getBiometricType()) Loading Loading @@ -248,7 +250,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(eq(false)); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_UNLOCK_COLLAPSING); Loading Loading @@ -327,7 +330,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_SHOW_BOUNCER); } Loading Loading @@ -359,7 +363,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthenticated(UserHandle.USER_CURRENT, BiometricSourceType.FACE, true /* isStrongBiometric */); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); assertThat(mBiometricUnlockController.getMode()) .isEqualTo(BiometricUnlockController.MODE_NONE); } Loading Loading @@ -438,17 +443,20 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { // WHEN udfps fails once - then don't show the bouncer yet mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN udfps fails the second time - then don't show the bouncer yet mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN udpfs fails the third time mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); // THEN show the bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true, "BiometricUnlockController#MODE_SHOW_BOUNCER"); } @Test Loading @@ -460,14 +468,16 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); mBiometricUnlockController.onBiometricAuthFailed(BiometricSourceType.FINGERPRINT); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager, never()).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); // WHEN lockout is received mBiometricUnlockController.onBiometricError(FingerprintManager.FINGERPRINT_ERROR_LOCKOUT, "Lockout", BiometricSourceType.FINGERPRINT); // THEN show bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(true, "BiometricUnlockController#MODE_SHOW_BOUNCER"); } @Test Loading Loading @@ -544,7 +554,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { BiometricSourceType.FINGERPRINT, true /* isStrongBiometric */); // THEN shows primary bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); } @Test Loading @@ -554,7 +565,8 @@ public class BiometricsUnlockControllerTest extends SysuiTestCase { BiometricSourceType.FACE, false /* isStrongBiometric */); // THEN shows primary bouncer verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean()); verify(mStatusBarKeyguardViewManager).showPrimaryBouncer(anyBoolean(), eq("BiometricUnlockController#MODE_SHOW_BOUNCER")); } private void givenFingerprintModeUnlockCollapsing() { Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java +2 −1 Original line number Diff line number Diff line Loading @@ -124,7 +124,8 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase { mRemoteInputCallback.onLockedRemoteInput( mock(ExpandableNotificationRow.class), mock(View.class)); verify(mStatusBarKeyguardViewManager).showBouncer(true); verify(mStatusBarKeyguardViewManager).showBouncer(true, "StatusBarRemoteInputCallback#onLockedRemoteInput"); } @Test @DisableFlags(ExpandHeadsUpOnInlineReply.FLAG_NAME) Loading