From 01aa146c2dc8a2b43955818443bbc440500ae7eb Mon Sep 17 00:00:00 2001 From: Justin Weir Date: Mon, 30 Jan 2023 12:45:25 -0500 Subject: [PATCH] Ignore ACTION_DOWN events when mTracking is true This is a partial fix for b/198553252 that lessens the effects and prevents possible side effects but does not address the root cause, which is the fact that these events are ACTION_DOWN instead of ACTION_POINTER_DOWN. The second finger touches do cause the height of the shade to jump, which is not ideal, but it was unanimously preferred over dismissing the shade when I polled the team. Test: manual and atest Bug: 198553252 Change-Id: I8b087bd435622dcc66e98c731cee1558272be515 --- .../shade/NotificationPanelViewController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 296c6319fc226..6c04eb7c4400d 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -6135,6 +6135,11 @@ public final class NotificationPanelViewController implements Dumpable { switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: + if (mTracking) { + // TODO(b/247126247) fix underlying issue. Should be ACTION_POINTER_DOWN. + mShadeLog.d("Don't intercept down event while already tracking"); + return false; + } mCentralSurfaces.userActivity(); mAnimatingOnDown = mHeightAnimator != null && !mIsSpringBackAnimation; mMinExpandHeight = 0.0f; @@ -6222,6 +6227,11 @@ public final class NotificationPanelViewController implements Dumpable { "onTouch: duplicate down event detected... ignoring"); return true; } + if (mTracking) { + // TODO(b/247126247) fix underlying issue. Should be ACTION_POINTER_DOWN. + mShadeLog.d("Don't handle down event while already tracking"); + return true; + } mLastTouchDownTime = event.getDownTime(); }