Merge "Create a new Transaction to apply the edge extensions" into tm-dev am: 4d9da9281b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17587084 Change-Id: Icc2e2c012c058eda9cd9352ba095f6abfc865b1e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -176,13 +176,24 @@ class SurfaceAnimationRunner {
|
|||||||
t.addTransactionCommittedListener(Runnable::run, () -> {
|
t.addTransactionCommittedListener(Runnable::run, () -> {
|
||||||
final WindowAnimationSpec animationSpec = a.asWindowAnimationSpec();
|
final WindowAnimationSpec animationSpec = a.asWindowAnimationSpec();
|
||||||
|
|
||||||
|
final Transaction edgeExtensionCreationTransaction = new Transaction();
|
||||||
edgeExtendWindow(animationLeash,
|
edgeExtendWindow(animationLeash,
|
||||||
animationSpec.getRootTaskBounds(), animationSpec.getAnimation(),
|
animationSpec.getRootTaskBounds(), animationSpec.getAnimation(),
|
||||||
mFrameTransaction);
|
edgeExtensionCreationTransaction);
|
||||||
|
|
||||||
synchronized (mLock) {
|
synchronized (mLock) {
|
||||||
// only run if animation is not yet canceled by this point
|
// only run if animation is not yet canceled by this point
|
||||||
if (mPreProcessingAnimations.get(animationLeash) == runningAnim) {
|
if (mPreProcessingAnimations.get(animationLeash) == runningAnim) {
|
||||||
|
// In the case the animation is cancelled, edge extensions are removed
|
||||||
|
// onAnimationLeashLost which is called before onAnimationCancelled.
|
||||||
|
// So we need to check if the edge extensions have already been removed
|
||||||
|
// or not, and if so we don't want to apply the transaction.
|
||||||
|
synchronized (mEdgeExtensionLock) {
|
||||||
|
if (!mEdgeExtensions.isEmpty()) {
|
||||||
|
edgeExtensionCreationTransaction.apply();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mPreProcessingAnimations.remove(animationLeash);
|
mPreProcessingAnimations.remove(animationLeash);
|
||||||
mPendingAnimations.put(animationLeash, runningAnim);
|
mPendingAnimations.put(animationLeash, runningAnim);
|
||||||
if (!mAnimationStartDeferred) {
|
if (!mAnimationStartDeferred) {
|
||||||
|
|||||||
Reference in New Issue
Block a user