Fix stale NSSL "fling" state caused by no-op fling am: 7f387f9ae9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19279469

Change-Id: I1b2c18f237c9ea380f25e6abe90c920af417b12b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Steve Elliott
2022-07-14 00:39:19 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 3 deletions

View File

@@ -599,9 +599,7 @@ public abstract class PanelViewController {
float collapseSpeedUpFactor, boolean expandBecauseOfFalsing) {
if (target == mExpandedHeight && mOverExpansion == 0.0f) {
// We're at the target and didn't fling and there's no overshoot
endJankMonitoring(CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE);
mKeyguardStateController.notifyPanelFlingEnd();
notifyExpandingFinished();
onFlingEnd(false /* cancelled */);
return;
}
mIsFlinging = true;

View File

@@ -985,6 +985,21 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
verify(mKeyguardStateController).notifyPanelFlingEnd();
}
@Test
public void testSwipe_exactlyToTarget_notifiesNssl() {
// No over-expansion
mNotificationPanelViewController.setOverExpansion(0f);
// Fling to a target that is equal to the current position (i.e. a no-op fling).
mNotificationPanelViewController.flingToHeight(
0f,
true,
mNotificationPanelViewController.mExpandedHeight,
1f,
false);
// Verify that the NSSL is notified that the panel is *not* flinging.
verify(mNotificationStackScrollLayoutController).setPanelFlinging(false);
}
@Test
public void testDoubleTapRequired_Keyguard() {
FalsingManager.FalsingTapListener listener = getFalsingTapListener();