summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-04-04 02:23:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-04 02:23:18 +0000
commit025baaca783695a88f147c819aa5cd59fe5faad7 (patch)
treecf0b309e55ed147080c47c42e43e60287723f06b
parent9935249673b75203410d7d33032a626c4f7293ca (diff)
parentc0e4c56696b88d3c87db25d0323cecfa40f362bd (diff)
downloadframeworks_base-025baaca783695a88f147c819aa5cd59fe5faad7.tar.gz
frameworks_base-025baaca783695a88f147c819aa5cd59fe5faad7.tar.bz2
frameworks_base-025baaca783695a88f147c819aa5cd59fe5faad7.zip
Merge "Don't crash if NSSL gets incomplete gesture" into qt-qpr1-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index 7c49c3f961c..073e474fed1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -3773,9 +3773,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
initVelocityTrackerIfNotExists();
mVelocityTracker.addMovement(ev);
- final int action = ev.getAction();
+ final int action = ev.getActionMasked();
+ if (ev.findPointerIndex(mActivePointerId) == -1 && action != MotionEvent.ACTION_DOWN) {
+ // Incomplete gesture, possibly due to window swap mid-gesture. Ignore until a new
+ // one starts.
+ Log.e(TAG, "Invalid pointerId=" + mActivePointerId + " in onTouchEvent "
+ + MotionEvent.actionToString(ev.getActionMasked()));
+ return true;
+ }
- switch (action & MotionEvent.ACTION_MASK) {
+ switch (action) {
case MotionEvent.ACTION_DOWN: {
if (getChildCount() == 0 || !isInContentBounds(ev)) {
return false;