Apply transaction before calling onFinish

A split pair may be dismiss in the background and the stage will skip
the fade out transition. This will cause onFinish being executed
immediately. So move the apply transaction operation before requesting
fade out to ensure the order of execution.

Bug: 269126417
Test: nexus_oop_test_multi_device_platform
Change-Id: I696a38fb6ab4d702127b530cd4a20492b5ad09aa
This commit is contained in:
Chilun Huang
2023-02-16 16:01:34 +08:00
parent 32a041826d
commit 4ff27cb758

View File

@@ -193,6 +193,8 @@ class SplitScreenTransitions {
mAnimatingTransition = transition;
mFinishTransaction = finishTransaction;
startTransaction.apply();
final SplitDecorManager topDecor = mPendingDismiss.mDismissTop == STAGE_TYPE_MAIN
? mainDecor : sideDecor;
topDecor.fadeOutDecor(() -> {
@@ -200,8 +202,6 @@ class SplitScreenTransitions {
onFinish(null /* wct */, null /* wctCB */);
});
});
startTransaction.apply();
} else {
playAnimation(transition, info, startTransaction, finishTransaction,
finishCallback, mainRoot, sideRoot, topRoot);