diff options
| author | 2023-05-19 15:13:22 +0100 | |
|---|---|---|
| committer | 2023-05-19 15:13:22 +0100 | |
| commit | cf4f4416c06ba254dd6be2aa3f7c82f66d8f616a (patch) | |
| tree | 37756f45fedaf3708f19918c44cd0485e3824dfc | |
| parent | 75c52789b7dc1bdda7e75aa5cd51ff229dfe424e (diff) | |
Fixing shade not collapsing after rotating from split shade
Issue was happening because when swiping to overscroll, mExpandImmediate in QS was set to true and was never reset. It should be true only when QS are in motion so the solution is to reset it after any motion is finished. Calling setExpandImmediate() twice is safe because if value doesn't change it doesn't do anything.
Bug: 282095041
Test: Open split shade -> scroll down to do overscrolling -> rotate to portrait -> QS should be collapsed
Test: NotificationPanelViewControllerTest#onShadeFlingEnd_mExpandImmediateShouldBeReset
Test: e2e test: SplitNotificationShadeRotateToPortrait
Change-Id: I0663bc28a48b2092546a2cb9a99993320fb7c8e4
2 files changed, 9 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index af12bc2ca9f8..db1db6c646d2 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2001,6 +2001,8 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump } updateExpansionAndVisibility(); mNotificationStackScrollLayoutController.setPanelFlinging(false); + // expandImmediate should be always reset at the end of animation + mQsController.setExpandImmediate(false); } private boolean isInContentBounds(float x, float y) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java index 48e0b53fc931..50074b72c0f5 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -1090,6 +1090,13 @@ public class NotificationPanelViewControllerTest extends NotificationPanelViewCo } @Test + public void onShadeFlingEnd_mExpandImmediateShouldBeReset() { + mNotificationPanelViewController.onFlingEnd(false); + + verify(mQsController).setExpandImmediate(false); + } + + @Test public void inUnlockedSplitShade_transitioningMaxTransitionDistance_makesShadeFullyExpanded() { mStatusBarStateController.setState(SHADE); enableSplitShade(true); |