summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/brightline/DistanceClassifier.java3
1 files changed, 2 insertions, 1 deletions
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 0329183e6048..9fa2557c2314 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<MotionEvent> 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);
}