Skip to content
Snippets Groups Projects
Commit 4b7206b8 authored by Chris Li's avatar Chris Li Committed by Gerrit Code Review
Browse files

Merge "[Bugfix][RemoteAnimation] Fix IndexOutOfBoundsException in...

Merge "[Bugfix][RemoteAnimation] Fix IndexOutOfBoundsException in onAnimationFinished of  RemoteAnimationController"
parents 09940f74 2d53bb2d
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment