diff options
| author | 2022-07-11 15:24:35 +0000 | |
|---|---|---|
| committer | 2022-07-11 15:24:35 +0000 | |
| commit | 18f2a05ba14ec12f775b209b54bd118023880d95 (patch) | |
| tree | 2d868b8c02747ed799662c856f05b7a9294b57f0 | |
| parent | cd34b85c53d5482a4bacb89f62c9616c8c0d3e09 (diff) | |
| parent | ea4a7a6cf9b34f01cbb0e38f8eb5131d9a6b8420 (diff) | |
Merge "Skip cancel of physics animators if not needed" into tm-qpr-dev am: ea4a7a6cf9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19237416
Change-Id: I0296265e2993f0570ee69b4266b2207b63c6e9dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt index b483fe03e80f..312af4ff7bc2 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/animation/PhysicsAnimator.kt @@ -829,8 +829,12 @@ class PhysicsAnimator<T> private constructor (target: T) { /** Cancels all in progress animations on all properties. */ fun cancel() { - cancelAction(flingAnimations.keys) - cancelAction(springAnimations.keys) + if (flingAnimations.size > 0) { + cancelAction(flingAnimations.keys) + } + if (springAnimations.size > 0) { + cancelAction(springAnimations.keys) + } } /** Cancels in progress animations on the provided properties only. */ |