Loading packages/SystemUI/src/com/android/systemui/keyguard/bouncer/data/factory/BouncerMessageFactory.kt +57 −95 Original line number Diff line number Diff line Loading @@ -36,43 +36,9 @@ import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.R.string.bouncer_face_not_recognized import com.android.systemui.R.string.keyguard_enter_password import com.android.systemui.R.string.keyguard_enter_pattern import com.android.systemui.R.string.keyguard_enter_pin import com.android.systemui.R.string.kg_bio_too_many_attempts_password import com.android.systemui.R.string.kg_bio_too_many_attempts_pattern import com.android.systemui.R.string.kg_bio_too_many_attempts_pin import com.android.systemui.R.string.kg_bio_try_again_or_password import com.android.systemui.R.string.kg_bio_try_again_or_pattern import com.android.systemui.R.string.kg_bio_try_again_or_pin import com.android.systemui.R.string.kg_face_locked_out import com.android.systemui.R.string.kg_fp_locked_out import com.android.systemui.R.string.kg_fp_not_recognized import com.android.systemui.R.string.kg_primary_auth_locked_out_password import com.android.systemui.R.string.kg_primary_auth_locked_out_pattern import com.android.systemui.R.string.kg_primary_auth_locked_out_pin import com.android.systemui.R.string.kg_prompt_after_dpm_lock import com.android.systemui.R.string.kg_prompt_after_user_lockdown_password import com.android.systemui.R.string.kg_prompt_after_user_lockdown_pattern import com.android.systemui.R.string.kg_prompt_after_user_lockdown_pin import com.android.systemui.R.string.kg_prompt_auth_timeout import com.android.systemui.R.string.kg_prompt_password_auth_timeout import com.android.systemui.R.string.kg_prompt_pattern_auth_timeout import com.android.systemui.R.string.kg_prompt_pin_auth_timeout import com.android.systemui.R.string.kg_prompt_reason_restart_password import com.android.systemui.R.string.kg_prompt_reason_restart_pattern import com.android.systemui.R.string.kg_prompt_reason_restart_pin import com.android.systemui.R.string.kg_prompt_unattended_update import com.android.systemui.R.string.kg_too_many_failed_attempts_countdown import com.android.systemui.R.string.kg_trust_agent_disabled import com.android.systemui.R.string.kg_unlock_with_password_or_fp import com.android.systemui.R.string.kg_unlock_with_pattern_or_fp import com.android.systemui.R.string.kg_unlock_with_pin_or_fp import com.android.systemui.R.string.kg_wrong_input_try_fp_suggestion import com.android.systemui.R.string.kg_wrong_password_try_again import com.android.systemui.R.string.kg_wrong_pattern_try_again import com.android.systemui.R.string.kg_wrong_pin_try_again import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.bouncer.shared.model.BouncerMessageModel import com.android.systemui.keyguard.bouncer.shared.model.Message Loading Loading @@ -186,175 +152,171 @@ private fun defaultMessage(securityMode: SecurityMode): Pair<Int, Int> { private fun defaultMessageWithFingerprint(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, 0) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, 0) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, 0) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectSecurityInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_wrong_pattern_try_again, 0) SecurityMode.Password -> Pair(kg_wrong_password_try_again, 0) SecurityMode.PIN -> Pair(kg_wrong_pin_try_again, 0) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectSecurityInputWithFingerprint(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_wrong_pattern_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.Password -> Pair(kg_wrong_password_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.PIN -> Pair(kg_wrong_pin_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFingerprintInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_pattern) SecurityMode.Password -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_password) SecurityMode.PIN -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFaceInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_pattern) SecurityMode.Password -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_password) SecurityMode.PIN -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFaceInputWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, bouncer_face_not_recognized) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, bouncer_face_not_recognized) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, bouncer_face_not_recognized) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun biometricLockout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_bio_too_many_attempts_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_bio_too_many_attempts_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_bio_too_many_attempts_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterReboot(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_reason_restart_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_reason_restart_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_reason_restart_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterAdminLockdown(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_after_dpm_lock) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_after_dpm_lock) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_after_dpm_lock) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterUserLockdown(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_after_user_lockdown_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_after_user_lockdown_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_after_user_lockdown_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredForUnattendedUpdate(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_unattended_update) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_unattended_update) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_unattended_update) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterPrimaryAuthTimeout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_pattern_auth_timeout) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_password_auth_timeout) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_pin_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun nonStrongAuthTimeout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_auth_timeout) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_auth_timeout) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun nonStrongAuthTimeoutWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, kg_prompt_auth_timeout) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, kg_prompt_auth_timeout) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, kg_prompt_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun faceUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_face_locked_out) SecurityMode.Password -> Pair(keyguard_enter_password, kg_face_locked_out) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_face_locked_out) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun fingerprintUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_fp_locked_out) SecurityMode.Password -> Pair(keyguard_enter_password, kg_fp_locked_out) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_fp_locked_out) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun trustAgentDisabled(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_trust_agent_disabled) SecurityMode.Password -> Pair(keyguard_enter_password, kg_trust_agent_disabled) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_trust_agent_disabled) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun trustAgentDisabledWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, kg_trust_agent_disabled) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, kg_trust_agent_disabled) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, kg_trust_agent_disabled) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun primaryAuthLockedOut(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_pattern) SecurityMode.Password -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_password) SecurityMode.PIN -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/data/factory/BouncerMessageFactoryTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock Loading @@ -42,6 +43,7 @@ import org.mockito.MockitoAnnotations @OptIn(ExperimentalCoroutinesApi::class) @SmallTest @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageFactoryTest : SysuiTestCase() { private lateinit var underTest: BouncerMessageFactory Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/data/repository/BouncerMessageRepositoryTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor Loading @@ -73,6 +74,7 @@ import org.mockito.MockitoAnnotations @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageRepositoryTest : SysuiTestCase() { @Mock private lateinit var updateMonitor: KeyguardUpdateMonitor Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/domain/interactor/BouncerMessageInteractorTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentMatchers.eq Loading @@ -53,6 +54,7 @@ import org.mockito.MockitoAnnotations @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageInteractorTest : SysuiTestCase() { @Mock private lateinit var securityModel: KeyguardSecurityModel Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +5 −28 Original line number Diff line number Diff line Loading @@ -61,7 +61,6 @@ import android.view.WindowInsets; import android.view.WindowInsetsAnimation; import android.widget.TextView; import androidx.test.annotation.UiThreadTest; import androidx.test.filters.SmallTest; import com.android.keyguard.BouncerPanelExpansionCalculator; Loading @@ -84,12 +83,11 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.FooterView; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -103,7 +101,6 @@ import java.util.ArrayList; /** * Tests for {@link NotificationStackScrollLayout}. */ @Ignore("b/255552856") @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper Loading @@ -113,7 +110,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { private NotificationStackScrollLayout mStackScrollerInternal; // See explanation below private AmbientState mAmbientState; private TestableResources mTestableResources; @Rule public MockitoRule mockito = MockitoJUnit.rule(); @Mock private CentralSurfaces mCentralSurfaces; @Mock private SysuiStatusBarStateController mBarState; Loading @@ -128,7 +124,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationSection mNotificationSection; @Mock private NotificationSwipeHelper mNotificationSwipeHelper; @Mock private NotificationStackScrollLayoutController mStackScrollLayoutController; @Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Mock private ScreenOffAnimationController mScreenOffAnimationController; @Mock private NotificationShelf mNotificationShelf; @Mock private NotificationStackSizeCalculator mNotificationStackSizeCalculator; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; Loading @@ -136,7 +132,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private FeatureFlags mFeatureFlags; @Before @UiThreadTest public void setUp() throws Exception { allowTestableLooperAsMainThread(); mTestableResources = mContext.getOrCreateTestableResources(); Loading @@ -162,7 +157,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mDependency.injectTestDependency(AmbientState.class, mAmbientState); mDependency.injectTestDependency(NotificationShelf.class, mNotificationShelf); mDependency.injectTestDependency( UnlockedScreenOffAnimationController.class, mUnlockedScreenOffAnimationController); ScreenOffAnimationController.class, mScreenOffAnimationController); NotificationShelfController notificationShelfController = mock(NotificationShelfController.class); Loading Loading @@ -364,7 +359,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetExpandedHeight_listenerReceivedCallbacks() { final float expectedHeight = 0f; Loading @@ -374,20 +368,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setExpandedHeight(expectedHeight); } @Test public void testAppearFractionCalculation() { // appear start position when(mNotificationShelf.getIntrinsicHeight()).thenReturn(100); // because it's the same as shelf height, appear start position equals shelf height mStackScroller.mStatusBarHeight = 100; // appear end position when(mEmptyShadeView.getHeight()).thenReturn(200); assertEquals(0f, mStackScroller.calculateAppearFraction(100)); assertEquals(1f, mStackScroller.calculateAppearFraction(200)); assertEquals(0.5f, mStackScroller.calculateAppearFraction(150)); } @Test public void testAppearFractionCalculationIsNotNegativeWhenShelfBecomesSmaller() { // this situation might occur if status bar height is defined in pixels while shelf height Loading @@ -405,7 +385,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetExpandedHeight_withSplitShade_doesntInterpolateStackHeight() { mTestableResources .addOverride(R.bool.config_use_split_notification_shade, /* value= */ true); Loading Loading @@ -590,6 +569,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testReInflatesFooterViews() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); mStackScroller.reinflateViews(); verify(mStackScroller).setFooterView(any()); Loading @@ -597,21 +577,18 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetIsBeingDraggedResetsExposedMenu() { mStackScroller.setIsBeingDragged(true); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); } @Test @UiThreadTest public void testPanelTrackingStartResetsExposedMenu() { mStackScroller.onPanelTrackingStarted(); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); } @Test @UiThreadTest public void testDarkModeResetsExposedMenu() { mStackScroller.setHideAmount(0.1f, 0.1f); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); Loading Loading @@ -916,7 +893,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setHasFilteredOutSeenNotifications(true); mStackScroller.updateEmptyShadeView(true, false); verify(mEmptyShadeView).setFooterText(not(0)); verify(mEmptyShadeView).setFooterText(not(eq(0))); } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/bouncer/data/factory/BouncerMessageFactory.kt +57 −95 Original line number Diff line number Diff line Loading @@ -36,43 +36,9 @@ import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TIMEOUT import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_TRUSTAGENT_EXPIRED import com.android.keyguard.KeyguardSecurityView.PROMPT_REASON_USER_REQUEST import com.android.keyguard.KeyguardUpdateMonitor import com.android.systemui.R.string.bouncer_face_not_recognized import com.android.systemui.R.string.keyguard_enter_password import com.android.systemui.R.string.keyguard_enter_pattern import com.android.systemui.R.string.keyguard_enter_pin import com.android.systemui.R.string.kg_bio_too_many_attempts_password import com.android.systemui.R.string.kg_bio_too_many_attempts_pattern import com.android.systemui.R.string.kg_bio_too_many_attempts_pin import com.android.systemui.R.string.kg_bio_try_again_or_password import com.android.systemui.R.string.kg_bio_try_again_or_pattern import com.android.systemui.R.string.kg_bio_try_again_or_pin import com.android.systemui.R.string.kg_face_locked_out import com.android.systemui.R.string.kg_fp_locked_out import com.android.systemui.R.string.kg_fp_not_recognized import com.android.systemui.R.string.kg_primary_auth_locked_out_password import com.android.systemui.R.string.kg_primary_auth_locked_out_pattern import com.android.systemui.R.string.kg_primary_auth_locked_out_pin import com.android.systemui.R.string.kg_prompt_after_dpm_lock import com.android.systemui.R.string.kg_prompt_after_user_lockdown_password import com.android.systemui.R.string.kg_prompt_after_user_lockdown_pattern import com.android.systemui.R.string.kg_prompt_after_user_lockdown_pin import com.android.systemui.R.string.kg_prompt_auth_timeout import com.android.systemui.R.string.kg_prompt_password_auth_timeout import com.android.systemui.R.string.kg_prompt_pattern_auth_timeout import com.android.systemui.R.string.kg_prompt_pin_auth_timeout import com.android.systemui.R.string.kg_prompt_reason_restart_password import com.android.systemui.R.string.kg_prompt_reason_restart_pattern import com.android.systemui.R.string.kg_prompt_reason_restart_pin import com.android.systemui.R.string.kg_prompt_unattended_update import com.android.systemui.R.string.kg_too_many_failed_attempts_countdown import com.android.systemui.R.string.kg_trust_agent_disabled import com.android.systemui.R.string.kg_unlock_with_password_or_fp import com.android.systemui.R.string.kg_unlock_with_pattern_or_fp import com.android.systemui.R.string.kg_unlock_with_pin_or_fp import com.android.systemui.R.string.kg_wrong_input_try_fp_suggestion import com.android.systemui.R.string.kg_wrong_password_try_again import com.android.systemui.R.string.kg_wrong_pattern_try_again import com.android.systemui.R.string.kg_wrong_pin_try_again import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.bouncer.shared.model.BouncerMessageModel import com.android.systemui.keyguard.bouncer.shared.model.Message Loading Loading @@ -186,175 +152,171 @@ private fun defaultMessage(securityMode: SecurityMode): Pair<Int, Int> { private fun defaultMessageWithFingerprint(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, 0) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, 0) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, 0) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectSecurityInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_wrong_pattern_try_again, 0) SecurityMode.Password -> Pair(kg_wrong_password_try_again, 0) SecurityMode.PIN -> Pair(kg_wrong_pin_try_again, 0) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectSecurityInputWithFingerprint(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_wrong_pattern_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.Password -> Pair(kg_wrong_password_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.PIN -> Pair(kg_wrong_pin_try_again, kg_wrong_input_try_fp_suggestion) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFingerprintInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_pattern) SecurityMode.Password -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_password) SecurityMode.PIN -> Pair(kg_fp_not_recognized, kg_bio_try_again_or_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFaceInput(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_pattern) SecurityMode.Password -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_password) SecurityMode.PIN -> Pair(bouncer_face_not_recognized, kg_bio_try_again_or_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun incorrectFaceInputWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, bouncer_face_not_recognized) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, bouncer_face_not_recognized) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, bouncer_face_not_recognized) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun biometricLockout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_bio_too_many_attempts_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_bio_too_many_attempts_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_bio_too_many_attempts_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterReboot(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_reason_restart_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_reason_restart_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_reason_restart_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterAdminLockdown(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_after_dpm_lock) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_after_dpm_lock) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_after_dpm_lock) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterUserLockdown(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_after_user_lockdown_pattern) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_after_user_lockdown_password) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_after_user_lockdown_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredForUnattendedUpdate(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_unattended_update) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_unattended_update) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_unattended_update) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun authRequiredAfterPrimaryAuthTimeout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_pattern_auth_timeout) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_password_auth_timeout) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_pin_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun nonStrongAuthTimeout(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_prompt_auth_timeout) SecurityMode.Password -> Pair(keyguard_enter_password, kg_prompt_auth_timeout) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_prompt_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun nonStrongAuthTimeoutWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, kg_prompt_auth_timeout) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, kg_prompt_auth_timeout) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, kg_prompt_auth_timeout) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun faceUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_face_locked_out) SecurityMode.Password -> Pair(keyguard_enter_password, kg_face_locked_out) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_face_locked_out) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun fingerprintUnlockUnavailable(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_fp_locked_out) SecurityMode.Password -> Pair(keyguard_enter_password, kg_fp_locked_out) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_fp_locked_out) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun trustAgentDisabled(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(keyguard_enter_pattern, kg_trust_agent_disabled) SecurityMode.Password -> Pair(keyguard_enter_password, kg_trust_agent_disabled) SecurityMode.PIN -> Pair(keyguard_enter_pin, kg_trust_agent_disabled) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun trustAgentDisabledWithFingerprintAllowed(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_unlock_with_pattern_or_fp, kg_trust_agent_disabled) SecurityMode.Password -> Pair(kg_unlock_with_password_or_fp, kg_trust_agent_disabled) SecurityMode.PIN -> Pair(kg_unlock_with_pin_or_fp, kg_trust_agent_disabled) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } } private fun primaryAuthLockedOut(securityMode: SecurityMode): Pair<Int, Int> { return when (securityMode) { SecurityMode.Pattern -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_pattern) SecurityMode.Password -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_password) SecurityMode.PIN -> Pair(kg_too_many_failed_attempts_countdown, kg_primary_auth_locked_out_pin) SecurityMode.Pattern -> Pair(keyguard_enter_pattern, 0) SecurityMode.Password -> Pair(keyguard_enter_password, 0) SecurityMode.PIN -> Pair(keyguard_enter_pin, 0) else -> Pair(0, 0) } }
packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/data/factory/BouncerMessageFactoryTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock Loading @@ -42,6 +43,7 @@ import org.mockito.MockitoAnnotations @OptIn(ExperimentalCoroutinesApi::class) @SmallTest @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageFactoryTest : SysuiTestCase() { private lateinit var underTest: BouncerMessageFactory Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/data/repository/BouncerMessageRepositoryTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runCurrent import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentCaptor Loading @@ -73,6 +74,7 @@ import org.mockito.MockitoAnnotations @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageRepositoryTest : SysuiTestCase() { @Mock private lateinit var updateMonitor: KeyguardUpdateMonitor Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/bouncer/domain/interactor/BouncerMessageInteractorTest.kt +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import org.junit.Before import org.junit.Ignore import org.junit.Test import org.junit.runner.RunWith import org.mockito.ArgumentMatchers.eq Loading @@ -53,6 +54,7 @@ import org.mockito.MockitoAnnotations @SmallTest @TestableLooper.RunWithLooper(setAsMainLooper = true) @RunWith(AndroidJUnit4::class) @Ignore("b/236891644") class BouncerMessageInteractorTest : SysuiTestCase() { @Mock private lateinit var securityModel: KeyguardSecurityModel Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +5 −28 Original line number Diff line number Diff line Loading @@ -61,7 +61,6 @@ import android.view.WindowInsets; import android.view.WindowInsetsAnimation; import android.widget.TextView; import androidx.test.annotation.UiThreadTest; import androidx.test.filters.SmallTest; import com.android.keyguard.BouncerPanelExpansionCalculator; Loading @@ -84,12 +83,11 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.FooterView; import com.android.systemui.statusbar.phone.CentralSurfaces; import com.android.systemui.statusbar.phone.KeyguardBypassController; import com.android.systemui.statusbar.phone.ScreenOffAnimationController; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.phone.UnlockedScreenOffAnimationController; import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; Loading @@ -103,7 +101,6 @@ import java.util.ArrayList; /** * Tests for {@link NotificationStackScrollLayout}. */ @Ignore("b/255552856") @SmallTest @RunWith(AndroidTestingRunner.class) @TestableLooper.RunWithLooper Loading @@ -113,7 +110,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { private NotificationStackScrollLayout mStackScrollerInternal; // See explanation below private AmbientState mAmbientState; private TestableResources mTestableResources; @Rule public MockitoRule mockito = MockitoJUnit.rule(); @Mock private CentralSurfaces mCentralSurfaces; @Mock private SysuiStatusBarStateController mBarState; Loading @@ -128,7 +124,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private NotificationSection mNotificationSection; @Mock private NotificationSwipeHelper mNotificationSwipeHelper; @Mock private NotificationStackScrollLayoutController mStackScrollLayoutController; @Mock private UnlockedScreenOffAnimationController mUnlockedScreenOffAnimationController; @Mock private ScreenOffAnimationController mScreenOffAnimationController; @Mock private NotificationShelf mNotificationShelf; @Mock private NotificationStackSizeCalculator mNotificationStackSizeCalculator; @Mock private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager; Loading @@ -136,7 +132,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Mock private FeatureFlags mFeatureFlags; @Before @UiThreadTest public void setUp() throws Exception { allowTestableLooperAsMainThread(); mTestableResources = mContext.getOrCreateTestableResources(); Loading @@ -162,7 +157,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mDependency.injectTestDependency(AmbientState.class, mAmbientState); mDependency.injectTestDependency(NotificationShelf.class, mNotificationShelf); mDependency.injectTestDependency( UnlockedScreenOffAnimationController.class, mUnlockedScreenOffAnimationController); ScreenOffAnimationController.class, mScreenOffAnimationController); NotificationShelfController notificationShelfController = mock(NotificationShelfController.class); Loading Loading @@ -364,7 +359,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetExpandedHeight_listenerReceivedCallbacks() { final float expectedHeight = 0f; Loading @@ -374,20 +368,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setExpandedHeight(expectedHeight); } @Test public void testAppearFractionCalculation() { // appear start position when(mNotificationShelf.getIntrinsicHeight()).thenReturn(100); // because it's the same as shelf height, appear start position equals shelf height mStackScroller.mStatusBarHeight = 100; // appear end position when(mEmptyShadeView.getHeight()).thenReturn(200); assertEquals(0f, mStackScroller.calculateAppearFraction(100)); assertEquals(1f, mStackScroller.calculateAppearFraction(200)); assertEquals(0.5f, mStackScroller.calculateAppearFraction(150)); } @Test public void testAppearFractionCalculationIsNotNegativeWhenShelfBecomesSmaller() { // this situation might occur if status bar height is defined in pixels while shelf height Loading @@ -405,7 +385,6 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetExpandedHeight_withSplitShade_doesntInterpolateStackHeight() { mTestableResources .addOverride(R.bool.config_use_split_notification_shade, /* value= */ true); Loading Loading @@ -590,6 +569,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testReInflatesFooterViews() { when(mEmptyShadeView.getTextResource()).thenReturn(R.string.empty_shade_text); clearInvocations(mStackScroller); mStackScroller.reinflateViews(); verify(mStackScroller).setFooterView(any()); Loading @@ -597,21 +577,18 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { } @Test @UiThreadTest public void testSetIsBeingDraggedResetsExposedMenu() { mStackScroller.setIsBeingDragged(true); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); } @Test @UiThreadTest public void testPanelTrackingStartResetsExposedMenu() { mStackScroller.onPanelTrackingStarted(); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); } @Test @UiThreadTest public void testDarkModeResetsExposedMenu() { mStackScroller.setHideAmount(0.1f, 0.1f); verify(mNotificationSwipeHelper).resetExposedMenuView(true, true); Loading Loading @@ -916,7 +893,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { mStackScroller.setHasFilteredOutSeenNotifications(true); mStackScroller.updateEmptyShadeView(true, false); verify(mEmptyShadeView).setFooterText(not(0)); verify(mEmptyShadeView).setFooterText(not(eq(0))); } @Test Loading