Fixing "adb shell cmd statusbar expand-settings" command in split shade

The command was not working because it used `flingSettings` method in lockscreen and every motion in split shade in lockscreen is now managed by LockscreenShadeTransitionController.
Circumventing LockscreenShadeTransitionController means some visibilities and alpha were out of sync and broken. Now we're using that class directly for split shade case and everything works smoothly.

Fixes: 228796547
Test: manual + NotificationPanelViewControllerTest
Change-Id: Icfadaf01cb95bd3590d6e2db0841fec26e64d5b8
This commit is contained in:
Michal Brzezinski
2022-05-03 17:38:50 +01:00
parent 239f082d75
commit 9b8362201e
2 changed files with 20 additions and 1 deletions

View File

@@ -1666,7 +1666,15 @@ public class NotificationPanelViewController extends PanelViewController {
mQsExpandImmediate = true;
setShowShelfOnly(true);
}
if (isFullyCollapsed()) {
if (mShouldUseSplitNotificationShade && isOnKeyguard()) {
// It's a special case as this method is likely to not be initiated by finger movement
// but rather called from adb shell or accessibility service.
// In the future method below could be used for non-split shade as well but currently
// motion in that case looks worse than using flingSettings.
// TODO: make below function transitioning smoothly also in portrait with empty target
mLockscreenShadeTransitionController.goToLockedShade(
/* expandedView= */null, /* needsQSAnimation= */false);
} else if (isFullyCollapsed()) {
expand(true /* animate */);
} else {
traceQsJank(true /* startTracing */, false /* wasCancelled */);

View File

@@ -1004,6 +1004,17 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
verify(mLargeScreenShadeHeaderController).setActive(false);
}
@Test
public void testExpandWithQsMethodIsUsingLockscreenTransitionController() {
enableSplitShade(/* enabled= */ true);
mStatusBarStateController.setState(KEYGUARD);
mNotificationPanelViewController.expandWithQs();
verify(mLockscreenShadeTransitionController).goToLockedShade(
/* expandedView= */null, /* needsQSAnimation= */false);
}
@Test
public void testUnlockAnimationDoesNotAffectScrim() {
mNotificationPanelViewController.onUnlockHintStarted();