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

Commit d0c09925 authored by Steve Elliott's avatar Steve Elliott
Browse files

[flexiglass] Only show full notifications on lockscreen

Flag: com.android.systemui.scene_container
Fixes: 359898262
Test: atest NotificationStackScrollLayoutTest
Change-Id: I938c93bdda5312900f5baaf9b38d0a62f6268e46
parent 16d6b15b
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1487,7 +1487,14 @@ public class NotificationStackScrollLayout

    private float updateStackEndHeight() {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return 0f;
        float height = Math.max(0f, mAmbientState.getStackCutoff() - mAmbientState.getStackTop());
        final float height;
        if (mMaxDisplayedNotifications != -1) {
            // The stack intrinsic height already contains the correct value when there is a limit
            // in the max number of notifications (e.g. as in keyguard).
            height = mIntrinsicContentHeight;
        } else {
            height = Math.max(0f, mAmbientState.getStackCutoff() - mAmbientState.getStackTop());
        }
        mAmbientState.setStackEndHeight(height);
        return height;
    }
+14 −0
Original line number Diff line number Diff line
@@ -353,6 +353,20 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        verify(mAmbientState).setStackHeight(stackEndHeight);
    }

    @Test
    @EnableSceneContainer
    public void updateStackEndHeightAndStackHeight_maxNotificationsSet_withSceneContainer() {
        float stackHeight = 300f;
        when(mStackSizeCalculator.computeHeight(eq(mStackScroller), anyInt(), anyFloat()))
                .thenReturn(stackHeight);
        mStackScroller.setMaxDisplayedNotifications(3); // any non-zero amount

        clearInvocations(mAmbientState);
        mStackScroller.updateStackEndHeightAndStackHeight(1f);

        verify(mAmbientState).setStackHeight(eq(300f));
    }

    @Test
    public void updateStackEndHeightAndStackHeight_onlyUpdatesStackHeightDuringSwipeUp() {
        final float expansionFraction = 0.5f;