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
This commit is contained in:
Jerry Chang
2022-09-07 03:41:25 +00:00
parent 76395aec8b
commit e32c8fb9c2

View File

@@ -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) {