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>
This commit is contained in:
@@ -70,6 +70,7 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
final ArrayList<NonAppWindowAnimationAdapter> mPendingNonAppAnimations = new ArrayList<>();
|
final ArrayList<NonAppWindowAnimationAdapter> mPendingNonAppAnimations = new ArrayList<>();
|
||||||
private final Handler mHandler;
|
private final Handler mHandler;
|
||||||
private final Runnable mTimeoutRunnable = () -> cancelAnimation("timeoutRunnable");
|
private final Runnable mTimeoutRunnable = () -> cancelAnimation("timeoutRunnable");
|
||||||
|
private boolean mIsFinishing;
|
||||||
|
|
||||||
private FinishedCallback mFinishedCallback;
|
private FinishedCallback mFinishedCallback;
|
||||||
private boolean mCanceled;
|
private boolean mCanceled;
|
||||||
@@ -260,6 +261,7 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
mPendingAnimations.size());
|
mPendingAnimations.size());
|
||||||
mHandler.removeCallbacks(mTimeoutRunnable);
|
mHandler.removeCallbacks(mTimeoutRunnable);
|
||||||
synchronized (mService.mGlobalLock) {
|
synchronized (mService.mGlobalLock) {
|
||||||
|
mIsFinishing = true;
|
||||||
unlinkToDeathOfRunner();
|
unlinkToDeathOfRunner();
|
||||||
releaseFinishedCallback();
|
releaseFinishedCallback();
|
||||||
mService.openSurfaceTransaction();
|
mService.openSurfaceTransaction();
|
||||||
@@ -304,6 +306,7 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
mService.closeSurfaceTransaction("RemoteAnimationController#finished");
|
mService.closeSurfaceTransaction("RemoteAnimationController#finished");
|
||||||
|
mIsFinishing = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Reset input for all activities when the remote animation is finished.
|
// Reset input for all activities when the remote animation is finished.
|
||||||
@@ -521,6 +524,9 @@ class RemoteAnimationController implements DeathRecipient {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationCancelled(SurfaceControl animationLeash) {
|
public void onAnimationCancelled(SurfaceControl animationLeash) {
|
||||||
|
if (mIsFinishing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mRecord.mAdapter == this) {
|
if (mRecord.mAdapter == this) {
|
||||||
mRecord.mAdapter = null;
|
mRecord.mAdapter = null;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user