Merge "Fix issues with early-finish" into tm-qpr-dev

This commit is contained in:
Evan Rosky
2022-06-28 16:24:18 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 3 deletions

View File

@@ -866,13 +866,19 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
});
};
va.addListener(new AnimatorListenerAdapter() {
private boolean mFinished = false;
@Override
public void onAnimationEnd(Animator animation) {
if (mFinished) return;
mFinished = true;
finisher.run();
}
@Override
public void onAnimationCancel(Animator animation) {
if (mFinished) return;
mFinished = true;
finisher.run();
}
});

View File

@@ -220,9 +220,9 @@ public class RemoteAnimationAdapterCompat {
for (int i = info.getChanges().size() - 1; i >= 0; --i) {
info.getChanges().get(i).getLeash().release();
}
for (int i = leashMap.size() - 1; i >= 0; --i) {
leashMap.valueAt(i).release();
}
// Don't release here since launcher might still be using them. Instead
// let launcher release them (eg. via RemoteAnimationTargets)
leashMap.clear();
try {
finishCallback.onTransitionFinished(null /* wct */, finishTransaction);
} catch (RemoteException e) {