Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +6 −2 Original line number Diff line number Diff line Loading @@ -4455,10 +4455,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mSectionsManager.setHeaderForegroundColors(onSurface, onSurfaceVariant); if (mFooterView != null) { mFooterView.updateColors(); } if (mEmptyShadeView != null) { mEmptyShadeView.setTextColors(onSurface, onSurfaceVariant); } } void goToFullShade(long delay) { mGoToFullShadeNeedsAnimation = true; Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { @Mock private JavaAdapter mJavaAdapter; @Mock private CastController mCastController; @Mock private SharedNotificationContainerInteractor mSharedNotificationContainerInteractor; @Mock private ActiveNotificationsInteractor mActiveNotificationsInteractor; @Mock protected ActiveNotificationsInteractor mActiveNotificationsInteractor; @Mock private KeyguardClockPositionAlgorithm mKeyguardClockPositionAlgorithm; @Mock private NaturalScrollingSettingObserver mNaturalScrollingSettingObserver; Loading packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -456,11 +456,13 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mNotificationPanelViewController.updateResources(); assertThat(getConstraintSetLayout(R.id.keyguard_status_view).endToEnd) .isEqualTo(R.id.qs_edge_guideline); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); mNotificationPanelViewController.updateResources(); assertThat(getConstraintSetLayout(R.id.keyguard_status_view).endToEnd) .isEqualTo(ConstraintSet.PARENT_ID); Loading @@ -469,6 +471,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_dozing_alwaysDozingOn_isCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -480,6 +483,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_dozing_alwaysDozingOff_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -491,6 +495,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_notDozing_alwaysDozingOn_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -502,6 +507,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_pulsing_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -514,6 +520,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_notPulsing_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -529,6 +536,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo // The conditions below would make the clock NOT be centered on split shade. // On single shade it should always be centered though. when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); setDozing(/* dozing= */ false, /* dozingAlwaysOn= */ false); Loading @@ -539,6 +547,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_isCentered_thenNot() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -553,6 +562,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_notifiesKeyguardMediaController() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -564,6 +574,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_isCentered_thenStillCenteredIfNoNotifs() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading Loading @@ -700,10 +711,12 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate */ true); } Loading @@ -715,10 +728,12 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController, times(2)) .displayClock(LARGE, /* animate */ true); Loading @@ -730,6 +745,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo public void testHasNotifications_switchesToLargeClockWhenEnteringSplitShade() { mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); enableSplitShade(/* enabled= */ true); Loading @@ -740,6 +756,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo public void testNoNotifications_switchesToLargeClockWhenEnteringSplitShade() { mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); enableSplitShade(/* enabled= */ true); Loading @@ -752,6 +769,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); enableSplitShade(/* enabled= */ false); Loading @@ -764,6 +782,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); enableSplitShade(/* enabled= */ false); Loading @@ -777,6 +796,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mMediaDataManager.hasActiveMediaOrRecommendation()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); clearInvocations(mKeyguardStatusViewController); mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false); Loading @@ -791,6 +811,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mMediaDataManager.hasActiveMediaOrRecommendation()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); clearInvocations(mKeyguardStatusViewController); mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false); Loading Loading @@ -847,6 +868,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo clearInvocations(mKeyguardStatusViewController); when(mMediaDataManager.hasActiveMedia()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mNotificationPanelViewController.setDozing(true, false); Loading @@ -863,6 +885,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo when(mResources.getBoolean(R.bool.force_small_clock_on_lockscreen)).thenReturn(true); when(mMediaDataManager.hasActiveMedia()).thenReturn(false); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); clearInvocations(mKeyguardStatusViewController); enableSplitShade(/* enabled= */ true); Loading @@ -881,6 +904,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo when(mResources.getBoolean(R.bool.force_small_clock_on_lockscreen)).thenReturn(true); when(mMediaDataManager.hasActiveMedia()).thenReturn(false); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); clearInvocations(mKeyguardStatusViewController); enableSplitShade(/* enabled= */ true); Loading @@ -898,11 +922,13 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo // one notification + media player visible when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate */ true); // only media player visible when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController, times(2)).displayClock(SMALL, true); verify(mKeyguardStatusViewController, never()).displayClock(LARGE, /* animate */ true); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.statusbar.notification.collection.render.NotifStackC import com.android.systemui.statusbar.notification.collection.render.NotifStats import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor import com.android.systemui.statusbar.notification.domain.interactor.RenderNotificationListInteractor import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor import com.android.systemui.statusbar.notification.stack.BUCKET_ALERTING import com.android.systemui.statusbar.notification.stack.BUCKET_SILENT Loading Loading @@ -80,7 +81,7 @@ class StackCoordinatorTest : SysuiTestCase() { } @Test @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME) @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME, FooterViewRefactor.FLAG_NAME) fun testUpdateNotificationIcons() { afterRenderListListener.onAfterRenderList(listOf(entry), stackController) verify(notificationIconAreaController).updateNotificationIcons(eq(listOf(entry))) Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +6 −2 Original line number Diff line number Diff line Loading @@ -4455,10 +4455,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable mSectionsManager.setHeaderForegroundColors(onSurface, onSurfaceVariant); if (mFooterView != null) { mFooterView.updateColors(); } if (mEmptyShadeView != null) { mEmptyShadeView.setTextColors(onSurface, onSurfaceVariant); } } void goToFullShade(long delay) { mGoToFullShadeNeedsAnimation = true; Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -341,7 +341,7 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase { @Mock private JavaAdapter mJavaAdapter; @Mock private CastController mCastController; @Mock private SharedNotificationContainerInteractor mSharedNotificationContainerInteractor; @Mock private ActiveNotificationsInteractor mActiveNotificationsInteractor; @Mock protected ActiveNotificationsInteractor mActiveNotificationsInteractor; @Mock private KeyguardClockPositionAlgorithm mKeyguardClockPositionAlgorithm; @Mock private NaturalScrollingSettingObserver mNaturalScrollingSettingObserver; Loading
packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +26 −0 Original line number Diff line number Diff line Loading @@ -456,11 +456,13 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mNotificationPanelViewController.updateResources(); assertThat(getConstraintSetLayout(R.id.keyguard_status_view).endToEnd) .isEqualTo(R.id.qs_edge_guideline); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); mNotificationPanelViewController.updateResources(); assertThat(getConstraintSetLayout(R.id.keyguard_status_view).endToEnd) .isEqualTo(ConstraintSet.PARENT_ID); Loading @@ -469,6 +471,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_dozing_alwaysDozingOn_isCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -480,6 +483,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_dozing_alwaysDozingOff_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -491,6 +495,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_notDozing_alwaysDozingOn_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -502,6 +507,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_pulsing_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -514,6 +520,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_splitShade_notPulsing_isNotCentered() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -529,6 +536,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo // The conditions below would make the clock NOT be centered on split shade. // On single shade it should always be centered though. when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); when(mNotificationListContainer.hasPulsingNotifications()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); setDozing(/* dozing= */ false, /* dozingAlwaysOn= */ false); Loading @@ -539,6 +547,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_isCentered_thenNot() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -553,6 +562,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_notifiesKeyguardMediaController() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading @@ -564,6 +574,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo @Test public void keyguardStatusView_willPlayDelayedDoze_isCentered_thenStillCenteredIfNoNotifs() { when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); mStatusBarStateController.setState(KEYGUARD); enableSplitShade(/* enabled= */ true); Loading Loading @@ -700,10 +711,12 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate */ true); } Loading @@ -715,10 +728,12 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(LARGE, /* animate */ true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController, times(2)) .displayClock(LARGE, /* animate */ true); Loading @@ -730,6 +745,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo public void testHasNotifications_switchesToLargeClockWhenEnteringSplitShade() { mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); enableSplitShade(/* enabled= */ true); Loading @@ -740,6 +756,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo public void testNoNotifications_switchesToLargeClockWhenEnteringSplitShade() { mStatusBarStateController.setState(KEYGUARD); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); enableSplitShade(/* enabled= */ true); Loading @@ -752,6 +769,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); enableSplitShade(/* enabled= */ false); Loading @@ -764,6 +782,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); clearInvocations(mKeyguardStatusViewController); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); enableSplitShade(/* enabled= */ false); Loading @@ -777,6 +796,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mMediaDataManager.hasActiveMediaOrRecommendation()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); clearInvocations(mKeyguardStatusViewController); mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false); Loading @@ -791,6 +811,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo enableSplitShade(/* enabled= */ true); when(mMediaDataManager.hasActiveMediaOrRecommendation()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); clearInvocations(mKeyguardStatusViewController); mNotificationPanelViewController.setDozing(/* dozing= */ true, /* animate= */ false); Loading Loading @@ -847,6 +868,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo clearInvocations(mKeyguardStatusViewController); when(mMediaDataManager.hasActiveMedia()).thenReturn(true); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); mNotificationPanelViewController.setDozing(true, false); Loading @@ -863,6 +885,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo when(mResources.getBoolean(R.bool.force_small_clock_on_lockscreen)).thenReturn(true); when(mMediaDataManager.hasActiveMedia()).thenReturn(false); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); clearInvocations(mKeyguardStatusViewController); enableSplitShade(/* enabled= */ true); Loading @@ -881,6 +904,7 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo when(mResources.getBoolean(R.bool.force_small_clock_on_lockscreen)).thenReturn(true); when(mMediaDataManager.hasActiveMedia()).thenReturn(false); when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); clearInvocations(mKeyguardStatusViewController); enableSplitShade(/* enabled= */ true); Loading @@ -898,11 +922,13 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo // one notification + media player visible when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(true); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController).displayClock(SMALL, /* animate */ true); // only media player visible when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); when(mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()).thenReturn(false); triggerPositionClockAndNotifications(); verify(mKeyguardStatusViewController, times(2)).displayClock(SMALL, true); verify(mKeyguardStatusViewController, never()).displayClock(LARGE, /* animate */ true); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt +2 −1 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import com.android.systemui.statusbar.notification.collection.render.NotifStackC import com.android.systemui.statusbar.notification.collection.render.NotifStats import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor import com.android.systemui.statusbar.notification.domain.interactor.RenderNotificationListInteractor import com.android.systemui.statusbar.notification.footer.shared.FooterViewRefactor import com.android.systemui.statusbar.notification.shared.NotificationIconContainerRefactor import com.android.systemui.statusbar.notification.stack.BUCKET_ALERTING import com.android.systemui.statusbar.notification.stack.BUCKET_SILENT Loading Loading @@ -80,7 +81,7 @@ class StackCoordinatorTest : SysuiTestCase() { } @Test @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME) @DisableFlags(NotificationIconContainerRefactor.FLAG_NAME, FooterViewRefactor.FLAG_NAME) fun testUpdateNotificationIcons() { afterRenderListListener.onAfterRenderList(listOf(entry), stackController) verify(notificationIconAreaController).updateNotificationIcons(eq(listOf(entry))) Loading