Merge "Showing small lockscreen clock when media player visible in split shade" into sc-v2-dev am: 1f172ff7de
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15328594 Change-Id: I9fa1eafe87323c418a77b285dcafe39d44c62ac8
This commit is contained in:
@@ -1315,7 +1315,8 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled();
|
boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled();
|
||||||
final boolean hasVisibleNotifications = mNotificationStackScrollLayoutController
|
final boolean hasVisibleNotifications = mNotificationStackScrollLayoutController
|
||||||
.getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
|
.getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
|
||||||
if (hasVisibleNotifications && !mShouldUseSplitNotificationShade) {
|
if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade)
|
||||||
|
|| (mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia())) {
|
||||||
mKeyguardStatusViewController.displayClock(SMALL);
|
mKeyguardStatusViewController.displayClock(SMALL);
|
||||||
} else {
|
} else {
|
||||||
mKeyguardStatusViewController.displayClock(LARGE);
|
mKeyguardStatusViewController.displayClock(LARGE);
|
||||||
|
|||||||
@@ -785,6 +785,24 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
verify(mKeyguardStatusViewController, never()).displayClock(SMALL);
|
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() {
|
private void triggerPositionClockAndNotifications() {
|
||||||
mNotificationPanelViewController.closeQs();
|
mNotificationPanelViewController.closeQs();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user