summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author William Xiao <wxyz@google.com> 2023-07-07 19:42:39 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-07-07 19:42:39 +0000
commita561364a3f5c717c5ad63e95ce78c8aaab0762fc (patch)
treee83a904e628b8cb7e8542810b27c8a8c4f0ebb34
parent31af677dfe8320e598a96774ddb3322275e2f188 (diff)
parent2199a9795fe8ff7b55c79663c6b960335de92edd (diff)
Merge "Suppress IndexOutOfBoundsException when cancelling low light animation" into udc-dev am: dcc5cf1712 am: 2199a9795f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23921015 Change-Id: I316c3a5fde210fc6658815918507084e67e81b8e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--libs/dream/lowlight/src/com/android/dream/lowlight/LowLightTransitionCoordinator.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/dream/lowlight/src/com/android/dream/lowlight/LowLightTransitionCoordinator.kt b/libs/dream/lowlight/src/com/android/dream/lowlight/LowLightTransitionCoordinator.kt
index 26efb55fa560..473603002b21 100644
--- a/libs/dream/lowlight/src/com/android/dream/lowlight/LowLightTransitionCoordinator.kt
+++ b/libs/dream/lowlight/src/com/android/dream/lowlight/LowLightTransitionCoordinator.kt
@@ -111,8 +111,14 @@ class LowLightTransitionCoordinator @Inject constructor() {
}
animator.addListener(listener)
continuation.invokeOnCancellation {
- animator.removeListener(listener)
- animator.cancel()
+ try {
+ animator.removeListener(listener)
+ animator.cancel()
+ } catch (exception: IndexOutOfBoundsException) {
+ // TODO(b/285666217): remove this try/catch once a proper fix is implemented.
+ // Cancelling the animator can cause an exception since we may be removing a
+ // listener during the cancellation. See b/285666217 for more details.
+ }
}
}
}