From ea18d20913a2bccb94d8673af444663c17a3ac95 Mon Sep 17 00:00:00 2001 From: Justin Weir Date: Mon, 9 Jan 2023 16:50:11 -0500 Subject: [PATCH] Ignore down touches in QS while animating This prevents touches inside the QS bounds from putting NPVC in a bad state that causes subsequent touches to be mishandled. Bug: 261156369 Test: manual and atest Change-Id: Ia5cab8c4104b1314bfca7189f0eba2e1175fed9b --- .../shade/NotificationPanelViewController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 8f512d0205b82..f8882cf9de5b9 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2421,7 +2421,7 @@ public final class NotificationPanelViewController implements Dumpable { mInitialTouchY = event.getY(); mInitialTouchX = event.getX(); } - if (!isFullyCollapsed()) { + if (!isFullyCollapsed() && !isShadeOrQsHeightAnimationRunning()) { handleQsDown(event); } // defer touches on QQS to shade while shade is collapsing. Added margin for error @@ -5211,6 +5211,11 @@ public final class NotificationPanelViewController implements Dumpable { } } + /** Returns whether a shade or QS expansion animation is running */ + private boolean isShadeOrQsHeightAnimationRunning() { + return mHeightAnimator != null && !mHintAnimationRunning && !mIsSpringBackAnimation; + } + /** * Phase 2: Bounce down. */ @@ -6228,8 +6233,7 @@ public final class NotificationPanelViewController implements Dumpable { mCollapsedAndHeadsUpOnDown = isFullyCollapsed() && mHeadsUpManager.hasPinnedHeadsUp(); addMovement(event); - boolean regularHeightAnimationRunning = mHeightAnimator != null - && !mHintAnimationRunning && !mIsSpringBackAnimation; + boolean regularHeightAnimationRunning = isShadeOrQsHeightAnimationRunning(); if (!mGestureWaitForTouchSlop || regularHeightAnimationRunning) { mTouchSlopExceeded = regularHeightAnimationRunning || mTouchSlopExceededBeforeDown;