From b0261472618c1c2c85d748ba689dff1781fcc555 Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Sat, 18 Feb 2023 08:50:34 +0000 Subject: Do not use sync on divider visibility changed. When we set divider visibility, we only use sync transcation on hidden case because we need do fade-in animation for show case. This might lead divider hidden on some race if we set hidden at first and show later case because the first hidden is waiting sync and apply later actually. Fix: 269049102 Test: manual Test: pass existing tests Change-Id: Ibdb91cc5c8e1d3a1f9c3726df7d467c7255998f0 --- .../src/com/android/wm/shell/splitscreen/StageCoordinator.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 2a6fbd2cee8c..746bfad56ea8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -1695,9 +1695,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } mSyncQueue.queue(wct); - mSyncQueue.runInSync(t -> { - setDividerVisibility(mainStageVisible, t); - }); + setDividerVisibility(mainStageVisible, null); } private void setDividerVisibility(boolean visible, @Nullable SurfaceControl.Transaction t) { @@ -1779,6 +1777,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, @Override public void onAnimationEnd(Animator animation) { + if (dividerLeash != null && dividerLeash.isValid()) { + transaction.setAlpha(dividerLeash, 1); + transaction.apply(); + } mTransactionPool.release(transaction); mDividerFadeInAnimator = null; } -- cgit v1.2.3-59-g8ed1b