Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -1385,8 +1385,10 @@ 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(); boolean splitShadeWithActiveMedia = mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia(); if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade) if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade) || (mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia())) { || (splitShadeWithActiveMedia && !mDozing)) { mKeyguardStatusViewController.displayClock(SMALL); mKeyguardStatusViewController.displayClock(SMALL); } else { } else { mKeyguardStatusViewController.displayClock(LARGE); mKeyguardStatusViewController.displayClock(LARGE); Loading Loading @@ -1450,7 +1452,7 @@ public class NotificationPanelViewController extends PanelViewController { .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null; boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null; boolean shouldBeCentered = !mShouldUseSplitNotificationShade boolean shouldBeCentered = !mShouldUseSplitNotificationShade || (!hasVisibleNotifications && !hasCommunalSurface); || (!hasVisibleNotifications && !hasCommunalSurface) || mDozing; if (mStatusViewCentered != shouldBeCentered) { if (mStatusViewCentered != shouldBeCentered) { mStatusViewCentered = shouldBeCentered; mStatusViewCentered = shouldBeCentered; ConstraintSet constraintSet = new ConstraintSet(); ConstraintSet constraintSet = new ConstraintSet(); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -844,6 +844,18 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { verify(mKeyguardStatusViewController, never()).displayClock(SMALL); 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 @Test public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() { public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() { mStatusBarStateController.setState(KEYGUARD); mStatusBarStateController.setState(KEYGUARD); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -1385,8 +1385,10 @@ 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(); boolean splitShadeWithActiveMedia = mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia(); if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade) if ((hasVisibleNotifications && !mShouldUseSplitNotificationShade) || (mShouldUseSplitNotificationShade && mMediaDataManager.hasActiveMedia())) { || (splitShadeWithActiveMedia && !mDozing)) { mKeyguardStatusViewController.displayClock(SMALL); mKeyguardStatusViewController.displayClock(SMALL); } else { } else { mKeyguardStatusViewController.displayClock(LARGE); mKeyguardStatusViewController.displayClock(LARGE); Loading Loading @@ -1450,7 +1452,7 @@ public class NotificationPanelViewController extends PanelViewController { .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia(); boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null; boolean hasCommunalSurface = mCommunalSource != null && mCommunalSource.get() != null; boolean shouldBeCentered = !mShouldUseSplitNotificationShade boolean shouldBeCentered = !mShouldUseSplitNotificationShade || (!hasVisibleNotifications && !hasCommunalSurface); || (!hasVisibleNotifications && !hasCommunalSurface) || mDozing; if (mStatusViewCentered != shouldBeCentered) { if (mStatusViewCentered != shouldBeCentered) { mStatusViewCentered = shouldBeCentered; mStatusViewCentered = shouldBeCentered; ConstraintSet constraintSet = new ConstraintSet(); ConstraintSet constraintSet = new ConstraintSet(); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -844,6 +844,18 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { verify(mKeyguardStatusViewController, never()).displayClock(SMALL); 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 @Test public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() { public void testDisplaysSmallClockOnLockscreenInSplitShadeWhenMediaIsPlaying() { mStatusBarStateController.setState(KEYGUARD); mStatusBarStateController.setState(KEYGUARD); Loading