From 4ff27cb758446fc74be3bddeab2dcaf5b35d7179 Mon Sep 17 00:00:00 2001 From: Chilun Huang Date: Thu, 16 Feb 2023 16:01:34 +0800 Subject: [PATCH] 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 --- .../android/wm/shell/splitscreen/SplitScreenTransitions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java index 2b21e77be9c13..520da92fad728 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java @@ -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);