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

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

Change-Id: I4cf1426b7bc3a525f7eaa71cac383deecf93a30d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Lyn Han
2022-05-11 22:57:13 +00:00
committed by Automerger Merge Worker
2 changed files with 9 additions and 0 deletions

View File

@@ -5517,6 +5517,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
*/ */
public void setFractionToShade(float fraction) { public void setFractionToShade(float fraction) {
mAmbientState.setFractionToShade(fraction); mAmbientState.setFractionToShade(fraction);
updateContentHeight(); // Recompute stack height with different section gap.
requestChildrenUpdate(); requestChildrenUpdate();
} }

View File

@@ -31,6 +31,8 @@ import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean; 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.ArgumentMatchers.eq;
import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.clearInvocations; import static org.mockito.Mockito.clearInvocations;
@@ -609,6 +611,12 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
assertTrue(mStackScroller.isInsideQsHeader(event2)); assertTrue(mStackScroller.isInsideQsHeader(event2));
} }
@Test
public void setFractionToShade_recomputesStackHeight() {
mStackScroller.setFractionToShade(1f);
verify(mNotificationStackSizeCalculator).computeHeight(any(), anyInt(), anyFloat());
}
private void setBarStateForTest(int state) { private void setBarStateForTest(int state) {
// Can't inject this through the listener or we end up on the actual implementation // 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. // rather than the mock because the spy just coppied the anonymous inner /shruggie.