summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Li <lihongyu@google.com> 2022-07-11 07:16:54 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-07-11 07:16:54 +0000
commitb7e86b3e01946c93a9c2a2986319898cdfc3c60f (patch)
tree152d33814f2d22552e7f7b8dc5b7b3deee4d4725
parent161cc7e56525d8f543a5fedf4de04c6116716775 (diff)
parent4b7206b8d83aa5e4475b0d436bde8395d529b73c (diff)
Merge "[Bugfix][RemoteAnimation] Fix IndexOutOfBoundsException in onAnimationFinished of RemoteAnimationController" am: 4b7206b8d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2132452 Change-Id: I037c99f3d83d49b2b66e4633a3bf39766e0dde5a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/wm/RemoteAnimationController.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/RemoteAnimationController.java b/services/core/java/com/android/server/wm/RemoteAnimationController.java
index 4a0a6e3c204b..e76ea643dbeb 100644
--- a/services/core/java/com/android/server/wm/RemoteAnimationController.java
+++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java
@@ -70,6 +70,7 @@ class RemoteAnimationController implements DeathRecipient {
final ArrayList<NonAppWindowAnimationAdapter> mPendingNonAppAnimations = new ArrayList<>();
private final Handler mHandler;
private final Runnable mTimeoutRunnable = () -> cancelAnimation("timeoutRunnable");
+ private boolean mIsFinishing;
private FinishedCallback mFinishedCallback;
private boolean mCanceled;
@@ -260,6 +261,7 @@ class RemoteAnimationController implements DeathRecipient {
mPendingAnimations.size());
mHandler.removeCallbacks(mTimeoutRunnable);
synchronized (mService.mGlobalLock) {
+ mIsFinishing = true;
unlinkToDeathOfRunner();
releaseFinishedCallback();
mService.openSurfaceTransaction();
@@ -304,6 +306,7 @@ class RemoteAnimationController implements DeathRecipient {
throw e;
} finally {
mService.closeSurfaceTransaction("RemoteAnimationController#finished");
+ mIsFinishing = false;
}
}
// Reset input for all activities when the remote animation is finished.
@@ -521,6 +524,9 @@ class RemoteAnimationController implements DeathRecipient {
@Override
public void onAnimationCancelled(SurfaceControl animationLeash) {
+ if (mIsFinishing) {
+ return;
+ }
if (mRecord.mAdapter == this) {
mRecord.mAdapter = null;
} else {