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
This commit is contained in:
Michal Brzezinski
2022-10-27 14:11:51 +01:00
parent 3c10ee01a9
commit 19f7e7c412
2 changed files with 10 additions and 1 deletions

View File

@@ -5040,7 +5040,7 @@ public final class NotificationPanelViewController {
}
public boolean isFullyExpanded() {
return mExpandedHeight >= getMaxPanelHeight();
return mExpandedHeight >= getMaxPanelTransitionDistance();
}
public boolean isFullyCollapsed() {

View File

@@ -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);