diff --git a/packages/SystemUI/src/com/android/systemui/classifier/brightline/DistanceClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/brightline/DistanceClassifier.java index 0329183e60481..9fa2557c23140 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/brightline/DistanceClassifier.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/brightline/DistanceClassifier.java @@ -112,7 +112,6 @@ class DistanceClassifier extends FalsingClassifier { private DistanceVectors calculateDistances() { // This code assumes that there will be no missed DOWN or UP events. - VelocityTracker velocityTracker = VelocityTracker.obtain(); List motionEvents = getRecentMotionEvents(); if (motionEvents.size() < 3) { @@ -120,6 +119,8 @@ class DistanceClassifier extends FalsingClassifier { return new DistanceVectors(0, 0, 0, 0); } + VelocityTracker velocityTracker = VelocityTracker.obtain(); + for (MotionEvent motionEvent : motionEvents) { velocityTracker.addMovement(motionEvent); }