Centering clock on AOD in split shade mode
Fixes: 201419264 Test: NotificationPanelViewControllerTest Change-Id: If0742883b429b4537eb4033fce06c64a32de20a8
This commit is contained in:
@@ -1385,8 +1385,10 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled();
|
||||
final boolean hasVisibleNotifications = mNotificationStackScrollLayoutController
|
||||
.getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
|
||||
boolean splitShadeWithActiveMedia =
|
||||
mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia();
|
||||
if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade)
|
||||
|| (mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia())) {
|
||||
|| (splitShadeWithActiveMedia && !mDozing)) {
|
||||
mKeyguardStatusViewController.displayClock(SMALL);
|
||||
} else {
|
||||
mKeyguardStatusViewController.displayClock(LARGE);
|
||||
@@ -1450,7 +1452,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
.getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
|
||||
boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null;
|
||||
boolean shouldBeCentered = !mShouldUseSplitNotificationShade
|
||||
|| (!hasVisibleNotifications && !hasCommunalSurface);
|
||||
|| (!hasVisibleNotifications && !hasCommunalSurface) || mDozing;
|
||||
if (mStatusViewCentered != shouldBeCentered) {
|
||||
mStatusViewCentered = shouldBeCentered;
|
||||
ConstraintSet constraintSet = new ConstraintSet();
|
||||
|
||||
@@ -844,6 +844,18 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
|
||||
verify(mKeyguardStatusViewController, never()).displayClock(SMALL);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSwitchesToBigClockInSplitShadeOnAod() {
|
||||
mStatusBarStateController.setState(KEYGUARD);
|
||||
enableSplitShade(/* enabled= */ true);
|
||||
when(mMediaDataManager.hasActiveMedia()).thenReturn(true);
|
||||
when(mNotificationStackScrollLayoutController.getVisibleNotificationCount()).thenReturn(2);
|
||||
|
||||
mNotificationPanelViewController.setDozing(true, false, null);
|
||||
|
||||
verify(mKeyguardStatusViewController).displayClock(LARGE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() {
|
||||
mStatusBarStateController.setState(KEYGUARD);
|
||||
|
||||
Reference in New Issue
Block a user