summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn Han <lynhan@google.com> 2022-05-12 00:35:42 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-05-12 00:35:42 +0000
commitb017b66728702902bde9897e79f3a8ccf47aad0c (patch)
tree6fb96caec3521f960d78d38d069dc3c364f3e1e1
parent1ca2625d4574466155ff705fbf1a75f18e9fe2f9 (diff)
parent07ad7496339876fbb2c06c1e301ee4470f67d064 (diff)
Merge "Fix one-icon shelf flicker after lockscreen swipe-down-and-let-go" into tm-dev am: 4f1b1df0af am: 07ad749633
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18185197 Change-Id: I96c9a43263f153822c7769df93ecb837f938fe0a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java1
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java8
2 files changed, 9 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 3ea5e5b753a3..24369e7b860f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -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();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index e8608fa76c06..63e0f53e093d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -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.