diff options
| author | 2022-10-27 14:11:51 +0100 | |
|---|---|---|
| committer | 2022-10-27 14:55:26 +0100 | |
| commit | 19f7e7c41266a5196c76899e7a7f0f2ac20cc4c5 (patch) | |
| tree | bf14622d95a58bdfcba34e1c32997adab7d25749 | |
| parent | 3c10ee01a9a39e8b61fb4a8b15c9d70c66d09a4a (diff) | |
Fixing SysUI reporting expanded split shade state to launcher
Split shade was not registering as being fully expanded as expanded height never reaches full shade height in that state - it reaches only maximum transition distance, so distance of swipe required for shade to fully visually expand.
Fixes: 254044267
Test: NotificationPanelViewControllerTest
Test: adding functional tests in ag/20299906
Change-Id: I734d82f1fc799e63d3fb0b33da780b8df572bc95
2 files changed, 10 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index ddb57f74cacf..5ce49226b892 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -5040,7 +5040,7 @@ public final class NotificationPanelViewController { } public boolean isFullyExpanded() { - return mExpandedHeight >= getMaxPanelHeight(); + return mExpandedHeight >= getMaxPanelTransitionDistance(); } public boolean isFullyCollapsed() { 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 02f28a235b95..27efa1a45393 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerTest.java @@ -1683,6 +1683,15 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase { inOrder.verify(mNotificationStackScrollLayoutController).onExpansionStopped(); } + @Test + public void inUnlockedSplitShade_transitioningMaxTransitionDistance_makesShadeFullyExpanded() { + mStatusBarStateController.setState(SHADE); + enableSplitShade(true); + int transitionDistance = mNotificationPanelViewController.getMaxPanelTransitionDistance(); + mNotificationPanelViewController.setExpandedHeight(transitionDistance); + assertThat(mNotificationPanelViewController.isFullyExpanded()).isTrue(); + } + private static MotionEvent createMotionEvent(int x, int y, int action) { return MotionEvent.obtain( /* downTime= */ 0, /* eventTime= */ 0, action, x, y, /* metaState= */ 0); |