diff options
| author | 2022-07-11 06:55:00 +0000 | |
|---|---|---|
| committer | 2022-07-11 06:55:00 +0000 | |
| commit | 4b7206b8d83aa5e4475b0d436bde8395d529b73c (patch) | |
| tree | 449d55ac149fbdefd9a9717a9f04848e8efbf1e0 | |
| parent | 09940f74cb1bc76c78cdff288a0232ed9d73f00a (diff) | |
| parent | 2d53bb2d9abf5d740bd8e4fbe11f87704de3bbd1 (diff) | |
Merge "[Bugfix][RemoteAnimation] Fix IndexOutOfBoundsException in onAnimationFinished of RemoteAnimationController"
| -rw-r--r-- | services/core/java/com/android/server/wm/RemoteAnimationController.java | 6 |
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 eeac230489f9..027f3aebc502 100644 --- a/services/core/java/com/android/server/wm/RemoteAnimationController.java +++ b/services/core/java/com/android/server/wm/RemoteAnimationController.java @@ -68,6 +68,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; @@ -246,6 +247,7 @@ class RemoteAnimationController implements DeathRecipient { mPendingAnimations.size()); mHandler.removeCallbacks(mTimeoutRunnable); synchronized (mService.mGlobalLock) { + mIsFinishing = true; unlinkToDeathOfRunner(); releaseFinishedCallback(); mService.openSurfaceTransaction(); @@ -290,6 +292,7 @@ class RemoteAnimationController implements DeathRecipient { throw e; } finally { mService.closeSurfaceTransaction("RemoteAnimationController#finished"); + mIsFinishing = false; } } setRunningRemoteAnimation(false); @@ -501,6 +504,9 @@ class RemoteAnimationController implements DeathRecipient { @Override public void onAnimationCancelled(SurfaceControl animationLeash) { + if (mIsFinishing) { + return; + } if (mRecord.mAdapter == this) { mRecord.mAdapter = null; } else { |