diff options
author | Michał Brzeziński <brzezinski@google.com> | 2021-07-20 10:11:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-07-20 10:11:12 +0000 |
commit | 1f172ff7de5e34f55b42b5237fd99e11a5743e90 (patch) | |
tree | f10262d7deb08c5b91f8c4a6f3b86684c55c08cd | |
parent | da634dae1036c2847d433006617ca5bd1a2d905c (diff) | |
parent | e79a41ac50cd7c9e7699025f7092269319859f08 (diff) |
Merge "Showing small lockscreen clock when media player visible in split shade" into sc-v2-dev
2 files changed, 20 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 1feed8042c93..ecb79c9e9d4c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -1315,7 +1315,8 @@ public class NotificationPanelViewController extends PanelViewController { boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled(); final boolean hasVisibleNotifications = mNotificationStackScrollLayoutController .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); - if (hasVisibleNotifications && !mShouldUseSplitNotificationShade) { + if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade) + || (mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia())) { mKeyguardStatusViewController.displayClock(SMALL); } else { mKeyguardStatusViewController.displayClock(LARGE); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java index a1e2cfcdfd97..16d21793fa9a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewTest.java @@ -785,6 +785,24 @@ public class NotificationPanelViewTest extends SysuiTestCase { verify(mKeyguardStatusViewController, never()).displayClock(SMALL); } + @Test + public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() { + mStatusBarStateController.setState(KEYGUARD); + enableSplitShade(); + when(mMediaDataManager.hasActiveMedia()).thenReturn(true); + + // one notification + media player visible + when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(1); + triggerPositionClockAndNotifications(); + verify(mKeyguardStatusViewController).displayClock(SMALL); + + // only media player visible + when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(0); + triggerPositionClockAndNotifications(); + verify(mKeyguardStatusViewController, times(2)).displayClock(SMALL); + verify(mKeyguardStatusViewController, never()).displayClock(LARGE); + } + private void triggerPositionClockAndNotifications() { mNotificationPanelViewController.closeQs(); } |