Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94a8f252 authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Centering clock on AOD in split shade mode

Fixes: 201419264
Test: NotificationPanelViewControllerTest
Change-Id: If0742883b429b4537eb4033fce06c64a32de20a8
Merged-In: If0742883b429b4537eb4033fce06c64a32de20a8
parent 97b654d8
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1256,8 +1256,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);
@@ -1319,7 +1321,8 @@ public class NotificationPanelViewController extends PanelViewController {
    private void updateKeyguardStatusViewAlignment(boolean animate) {
        boolean hasVisibleNotifications = mNotificationStackScrollLayoutController
                .getVisibleNotificationCount() != 0 || mMediaDataManager.hasActiveMedia();
        boolean shouldBeCentered = !mShouldUseSplitNotificationShade || !hasVisibleNotifications;
        boolean shouldBeCentered =
                !mShouldUseSplitNotificationShade || !hasVisibleNotifications || mDozing;
        if (mStatusViewCentered != shouldBeCentered) {
            mStatusViewCentered = shouldBeCentered;
            ConstraintSet constraintSet = new ConstraintSet();
+12 −0
Original line number Diff line number Diff line
@@ -777,6 +777,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);