From e32c8fb9c299df7ecddb2e97cbda49b339a6968d Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Wed, 7 Sep 2022 03:41:25 +0000 Subject: [PATCH] Fix wrong layout after quick switch back to a split pair The remote animation for entering split screen will be canceled if it's triggering by quick-switch gesture. Add back logic to update surface bounds after animation got canceled which were accidently removed by Icaabf2e1. Fix: 244671191 Test: won't have any side empty after quick siwtched to a split pair Test: atest WMShellFlickerTests Change-Id: I520e594188e03fda2619be3fb22455e7d8b06d41 --- .../com/android/wm/shell/splitscreen/StageCoordinator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 199007d7f577e..dcfe08d7a3299 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 @@ -579,8 +579,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, IRemoteAnimationFinishedCallback finishedCallback, SurfaceControl.Transaction t) { if (apps == null || apps.length == 0) { - onRemoteAnimationFinished(apps); + updateSurfaceBounds(mSplitLayout, t, false /* applyResizingOffset */); + setDividerVisibility(true, t); t.apply(); + onRemoteAnimationFinished(apps); try { adapter.getRunner().onAnimationCancelled(mKeyguardShowing); } catch (RemoteException e) { @@ -593,7 +595,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, nonApps = ArrayUtils.appendElement(RemoteAnimationTarget.class, nonApps, getDividerBarLegacyTarget()); - updateSurfaceBounds(mSplitLayout, t, false); + updateSurfaceBounds(mSplitLayout, t, false /* applyResizingOffset */); setDividerVisibility(true, t); for (int i = 0; i < apps.length; ++i) { if (apps[i].mode == MODE_OPENING) {