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

Commit 183d96a4 authored by Lyn Han's avatar Lyn Han Committed by Automerger Merge Worker
Browse files

Merge "Fix one-icon shelf flicker after lockscreen swipe-down-and-let-go" into...

Merge "Fix one-icon shelf flicker after lockscreen swipe-down-and-let-go" into tm-dev am: 4f1b1df0

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



Change-Id: I390855e0ddf91ffb0d7fb466b40287fe2dd36dd1
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 11f2f911 4f1b1df0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5517,6 +5517,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
     */
    public void setFractionToShade(float fraction) {
        mAmbientState.setFractionToShade(fraction);
        updateContentHeight();  // Recompute stack height with different section gap.
        requestChildrenUpdate();
    }

+8 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyFloat;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations;
@@ -612,6 +614,12 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        assertTrue(mStackScroller.isInsideQsHeader(event2));
    }

    @Test
    public void setFractionToShade_recomputesStackHeight() {
        mStackScroller.setFractionToShade(1f);
        verify(mNotificationStackSizeCalculator).computeHeight(any(), anyInt(), anyFloat());
    }

    private void setBarStateForTest(int state) {
        // Can't inject this through the listener or we end up on the actual implementation
        // rather than the mock because the spy just coppied the anonymous inner /shruggie.