Merge "Use motion event time instead of system time when detecting motion pause" into ub-launcher3-master
This commit is contained in:
commit
01ec89a2ac
5 files changed
+15
-11
No files matched your search
@@ -17,7 +17,6 @@ package com.android.quickstep.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.SystemClock;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.android.launcher3.Alarm;
|
||||
@@ -80,7 +79,7 @@ public class MotionPauseDetector {
|
||||
*
|
||||
* TODO: Use historical positions as well, e.g. {@link MotionEvent#getHistoricalY(int, int)}.
|
||||
*/
|
||||
public void addPosition(float position, float orthogonalPosition) {
|
||||
public void addPosition(float position, float orthogonalPosition, long time) {
|
||||
if (mFirstPosition == null) {
|
||||
mFirstPosition = position;
|
||||
}
|
||||
@@ -88,7 +87,6 @@ public class MotionPauseDetector {
|
||||
mFirstOrthogonalPosition = orthogonalPosition;
|
||||
}
|
||||
mForcePauseTimeout.setAlarm(FORCE_PAUSE_TIMEOUT);
|
||||
long time = SystemClock.uptimeMillis();
|
||||
if (mPreviousTime != null && mPreviousPosition != null) {
|
||||
long changeInTime = Math.max(1, time - mPreviousTime);
|
||||
float changeInPosition = position - mPreviousPosition;
|
||||
|
||||
Reference in new issue
Block a user