From c6499fb8a058f73b4c3a4686e7b0d852e5d15a0c Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Fri, 5 May 2023 09:29:40 +0000 Subject: [PATCH] Fix not showing divider when re-entering split with rotation I134c8c4e keeps a split pair in the background, the split layout might not be updated properly if the next entering split comes with rotation. This makes sure to update the split layout to show the divider with the correct orientation. Fix: 280876344 Test: atest WMShellFlickerTests:DismissSplitScreenByGoHomeBenchmark Change-Id: I47659b791cc479b92aa1d1851663d65e8a93aeab --- .../src/com/android/wm/shell/common/split/SplitLayout.java | 5 ++++- .../com/android/wm/shell/splitscreen/StageCoordinator.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index e7dede7575782..2832c553c20c8 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -412,7 +412,10 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange /** Releases and re-inflates {@link DividerView} on the root surface. */ public void update(SurfaceControl.Transaction t) { - if (!mInitialized) return; + if (!mInitialized) { + init(); + return; + } mSplitWindowManager.release(t); mImePositionProcessor.reset(); mSplitWindowManager.init(this, mInsetsState); 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 5c2f1438c08e2..b8373f3548ca8 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 @@ -1538,7 +1538,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, } void finishEnterSplitScreen(SurfaceControl.Transaction t) { - mSplitLayout.init(); + mSplitLayout.update(t); setDividerVisibility(true, t); // Ensure divider surface are re-parented back into the hierarchy at the end of the // transition. See Transition#buildFinishTransaction for more detail.