diff options
author | Matt Pietal <mpietal@google.com> | 2021-09-22 12:29:48 -0400 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-12-25 00:32:22 +0000 |
commit | f4871d8537c91e62c7d9506cde6e034af56b4252 (patch) | |
tree | 177d9416af7453867907f804d70f51900fb362a6 | |
parent | 1aea1a6365ba02c2e2aca3e192eb775a110b905b (diff) | |
download | base-f4871d8537c91e62c7d9506cde6e034af56b4252.tar.gz |
Handle duplicate DOWN event
After unlocking the device, an immediate swipe down to reveal the
shade (a very common user journey) can sometimes just directly to the
QS shade variant, instead of showing the expected QQS shade with
notifications. I have been unable to find root cause at this point,
however, I am aware that multiple ACTION_DOWN events are issued in
this case with the same downTime.
To fix, detect this very specific scenario and ignore the touch.
Fixes: 193350347
Test: manual, follow steps in bug (swipe down after unlock)
Change-Id: I84ba92fb0cf981b227afdff15cbe41c09ea56f5d
(cherry picked from commit 2e8d3e5e0929587d7b99b5e50ed7a8c1ef839496)
(cherry picked from commit 83d700c5938615cd4daae9da8204ec7a3d540808)
Merged-In:I84ba92fb0cf981b227afdff15cbe41c09ea56f5d
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 15e0716f8c49..82f865c57457 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -3868,6 +3868,9 @@ public class NotificationPanelViewController extends PanelViewController { @Override protected TouchHandler createTouchHandler() { return new TouchHandler() { + + private long mLastTouchDownTime = -1L; + @Override public boolean onInterceptTouchEvent(MotionEvent event) { if (mBlockTouches || mQsFullyExpanded && mQs.disallowPanelTouches()) { @@ -3897,6 +3900,19 @@ public class NotificationPanelViewController extends PanelViewController { @Override public boolean onTouch(View v, MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + if (event.getDownTime() == mLastTouchDownTime) { + // An issue can occur when swiping down after unlock, where multiple down + // events are received in this handler with identical downTimes. Until the + // source of the issue can be located, detect this case and ignore. + // see b/193350347 + Log.w(TAG, "Duplicate down event detected... ignoring"); + return true; + } + mLastTouchDownTime = event.getDownTime(); + } + + if (mBlockTouches || (mQsFullyExpanded && mQs != null && mQs.disallowPanelTouches())) { return false; |