From 19f7e7c41266a5196c76899e7a7f0f2ac20cc4c5 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Thu, 27 Oct 2022 14:11:51 +0100 Subject: 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 --- .../android/systemui/shade/NotificationPanelViewController.java | 2 +- .../systemui/shade/NotificationPanelViewControllerTest.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-59-g8ed1b