Merge "Don't crash if NSSL gets incomplete gesture" into qt-qpr1-dev am: 025baaca78

Change-Id: Ifdb10f3a140b040c34c37b6f84593b784cf93311
This commit is contained in:
TreeHugger Robot
2020-04-04 02:42:55 +00:00
committed by Automerger Merge Worker

View File

@@ -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;