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

Commit e46c5303 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Centering clock on AOD in split shade mode" into sc-v2-dev am: 05f5356e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934862

Change-Id: I8c122891799d468c5594f38b5e02bb69b7b2a3de
parents 7e5e168c 05f5356e
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1253,8 +1253,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);
@@ -1316,7 +1318,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);