summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Elliott <steell@google.com>2022-06-24 11:01:49 -0400
committerSteve Elliott <steell@google.com>2022-07-20 00:07:20 +0000
commit28dc43e6a7698f4e6ace7718ce71a2d7a5b8bec4 (patch)
tree1df3f62a7fd4b3757e7d8816e642cc4d00f85744
parentc29777f4059da03ac663c3cc5b61d0f011aac8bb (diff)
downloadbase-28dc43e6a7698f4e6ace7718ce71a2d7a5b8bec4.tar.gz
Fix stale NSSL "fling" state caused by no-op fling
If a fling gesture ends with the current Y position in the exact end position for the fling, then the code to run the fling animation is bypassed, but the flag in AmbientState tracking whether a fling is active is never reset. This CL replaces the short circuit logic with the standard fling-end logic, ensuring that all expected code paths are executed. Fixes: 234824085 Fixes: 237272856 Test: manual 1. Enter lockscreen 2. Swipe up and then down to the exact same position, in one continuous gesture 3. Wait for a notification update Observe: Shade resizes correctly to match the new contents Change-Id: Ie8ddf1dbaaf1ba607657646db05d3eb622fc9415 Merged-In: Ie8ddf1dbaaf1ba607657646db05d3eb622fc9415 (cherry picked from commit 7f387f9ae92490d7ab196eb2274019b543b8ab88)
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java15
2 files changed, 16 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
index 82ca842d48c9..5d417e0b59e2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
@@ -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;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
index d47644f047a2..8900d8ff9fda 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationPanelViewControllerTest.java
@@ -986,6 +986,21 @@ public class NotificationPanelViewControllerTest extends SysuiTestCase {
}
@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();
mStatusBarStateController.setState(KEYGUARD);