Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -4963,7 +4963,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable // Avoid Flicking during clear all // when the shade finishes closing, onExpansionStopped will call // resetScrollPosition to setOwnScrollY to 0 if (mAmbientState.isClosing()) { if (mAmbientState.isClosing() || mAmbientState.isClearAllInProgress()) { return; } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -785,6 +785,25 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertEquals(0, mAmbientState.getScrollY()); } @Test public void testSetOwnScrollY_clearAllInProgress_scrollYDoesNotChange() { // Given: clear all is in progress, scrollY is 0 mAmbientState.setScrollY(0); assertEquals(0, mAmbientState.getScrollY()); mAmbientState.setClearAllInProgress(true); // When: call NotificationStackScrollLayout.setOwnScrollY to set scrollY to 1 mStackScroller.setOwnScrollY(1); // Then: scrollY should not change, it should still be 0 assertEquals(0, mAmbientState.getScrollY()); // Reset scrollY and mAmbientState.mIsClosing to avoid interfering with other tests mAmbientState.setClearAllInProgress(false); mStackScroller.setOwnScrollY(0); assertEquals(0, mAmbientState.getScrollY()); } @Test public void onShadeFlingClosingEnd_scrollYShouldBeSetToZero() { // Given: mAmbientState.mIsClosing is set to be true Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +1 −1 Original line number Diff line number Diff line Loading @@ -4963,7 +4963,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable // Avoid Flicking during clear all // when the shade finishes closing, onExpansionStopped will call // resetScrollPosition to setOwnScrollY to 0 if (mAmbientState.isClosing()) { if (mAmbientState.isClosing() || mAmbientState.isClearAllInProgress()) { return; } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -785,6 +785,25 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { assertEquals(0, mAmbientState.getScrollY()); } @Test public void testSetOwnScrollY_clearAllInProgress_scrollYDoesNotChange() { // Given: clear all is in progress, scrollY is 0 mAmbientState.setScrollY(0); assertEquals(0, mAmbientState.getScrollY()); mAmbientState.setClearAllInProgress(true); // When: call NotificationStackScrollLayout.setOwnScrollY to set scrollY to 1 mStackScroller.setOwnScrollY(1); // Then: scrollY should not change, it should still be 0 assertEquals(0, mAmbientState.getScrollY()); // Reset scrollY and mAmbientState.mIsClosing to avoid interfering with other tests mAmbientState.setClearAllInProgress(false); mStackScroller.setOwnScrollY(0); assertEquals(0, mAmbientState.getScrollY()); } @Test public void onShadeFlingClosingEnd_scrollYShouldBeSetToZero() { // Given: mAmbientState.mIsClosing is set to be true Loading