summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt20
1 files changed, 11 insertions, 9 deletions
diff --git a/packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt b/packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt
index cd2dd04568a7..47ad0b3e0cd4 100644
--- a/packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt
+++ b/packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt
@@ -95,16 +95,18 @@ abstract class FlingOnBackAnimationCallback(
final override fun onBackProgressed(backEvent: BackEvent) {
val interpolatedProgress = progressInterpolator.getInterpolation(backEvent.progress)
if (predictiveBackTimestampApi()) {
- velocityTracker.addMovement(
- MotionEvent.obtain(
- /* downTime */ downTime!!,
- /* eventTime */ backEvent.frameTimeMillis,
- /* action */ ACTION_MOVE,
- /* x */ interpolatedProgress * SCALE_FACTOR,
- /* y */ 0f,
- /* metaState */ 0,
+ downTime?.let { downTime ->
+ velocityTracker.addMovement(
+ MotionEvent.obtain(
+ /* downTime */ downTime,
+ /* eventTime */ backEvent.frameTimeMillis,
+ /* action */ ACTION_MOVE,
+ /* x */ interpolatedProgress * SCALE_FACTOR,
+ /* y */ 0f,
+ /* metaState */ 0,
+ )
)
- )
+ }
lastBackEvent =
BackEvent(
backEvent.touchX,