diff options
| author | 2024-10-25 12:19:06 +0000 | |
|---|---|---|
| committer | 2024-10-25 12:19:06 +0000 | |
| commit | 3bb0c7b638c94e6214a4df8f155e7880225bdeec (patch) | |
| tree | 55245097d35e24a4d6c7357bdaf6f127649dfb2f | |
| parent | 9d4336553fc4973ad42ce61f7c92ffd08cdd9c0a (diff) | |
| parent | 3df09aa582794a78418150c6f13a4bb673d20004 (diff) | |
Merge "Fix NullPointerException in FlingOnBackAnimationCallback" into main
| -rw-r--r-- | packages/SystemUI/animation/src/com/android/systemui/animation/back/FlingOnBackAnimationCallback.kt | 20 |
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, |