Fixed Handler Leak on DistanceClassifier
A VelocityTracker object is not recycled in case of motionEvents.size()<3 at calculateDistances function.
private DistanceVectors calculateDistances() {
// This code assumes that there will be no missed DOWN or UP events.
VelocityTracker velocityTracker = VelocityTracker.obtain();
...
if (motionEvents.size() < 3) {
logDebug("Only " + motionEvents.size() + " motion events recorded.");
return new DistanceVectors(0, 0, 0, 0);
}
...
}
Test: Manual
Signed-off-by: Jiwon Kim <jiwon88.kim@samsung.com>
Change-Id: Ifca0c25411f56a4de79d89d262d2b4e61045a8ed
Loading
Please register or sign in to comment