Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,16 @@ constructor( /** Show the bouncer if necessary and set the relevant states. */ @JvmOverloads fun show(isScrimmed: Boolean) { if (primaryBouncerView.delegate == null) { Log.d( TAG, "PrimaryBouncerInteractor#show is being called before the " + "primaryBouncerDelegate is set. Let's exit early so we don't set the wrong " + "primaryBouncer state." ) return } // Reset some states as we show the bouncer. repository.setKeyguardAuthenticatedBiometrics(null) repository.setPrimaryStartingToHide(false) Loading packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,27 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { resources = context.orCreateTestableResources } @Test fun show_nullDelegate() { testScope.run { whenever(bouncerView.delegate).thenReturn(null) mainHandler.setMode(FakeHandler.Mode.QUEUEING) // WHEN bouncer show is requested underTest.show(true) // WHEN all queued messages are dispatched mainHandler.dispatchQueuedMessages() // THEN primary bouncer state doesn't update to show since delegate was null verify(repository, never()).setPrimaryShow(true) verify(repository, never()).setPrimaryShowingSoon(false) verify(mPrimaryBouncerCallbackInteractor, never()).dispatchStartingToShow() verify(mPrimaryBouncerCallbackInteractor, never()) .dispatchVisibilityChanged(View.VISIBLE) } } @Test fun testShow_isScrimmed() { underTest.show(true) Loading Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt +10 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,16 @@ constructor( /** Show the bouncer if necessary and set the relevant states. */ @JvmOverloads fun show(isScrimmed: Boolean) { if (primaryBouncerView.delegate == null) { Log.d( TAG, "PrimaryBouncerInteractor#show is being called before the " + "primaryBouncerDelegate is set. Let's exit early so we don't set the wrong " + "primaryBouncer state." ) return } // Reset some states as we show the bouncer. repository.setKeyguardAuthenticatedBiometrics(null) repository.setPrimaryStartingToHide(false) Loading
packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt +21 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,27 @@ class PrimaryBouncerInteractorTest : SysuiTestCase() { resources = context.orCreateTestableResources } @Test fun show_nullDelegate() { testScope.run { whenever(bouncerView.delegate).thenReturn(null) mainHandler.setMode(FakeHandler.Mode.QUEUEING) // WHEN bouncer show is requested underTest.show(true) // WHEN all queued messages are dispatched mainHandler.dispatchQueuedMessages() // THEN primary bouncer state doesn't update to show since delegate was null verify(repository, never()).setPrimaryShow(true) verify(repository, never()).setPrimaryShowingSoon(false) verify(mPrimaryBouncerCallbackInteractor, never()).dispatchStartingToShow() verify(mPrimaryBouncerCallbackInteractor, never()) .dispatchVisibilityChanged(View.VISIBLE) } } @Test fun testShow_isScrimmed() { underTest.show(true) Loading