Fix dragging the same app over a split app dismisses the split

Do not evict splitting children if the app start animation was canceled.
So it won't apply the evict transaction which empties the split.

Fix: 219139163
Test: manual check dropping the same app on the same side of the split
      won't dismiss the split.
Change-Id: I5a450e53d857813f4fd59ab157be7d36985673ea
This commit is contained in:
Jerry Chang
2022-02-14 09:55:27 +00:00
parent e429730809
commit a19699eaa1

View File

@@ -349,17 +349,20 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
RemoteAnimationTarget[] wallpapers, RemoteAnimationTarget[] nonApps,
IRemoteAnimationFinishedCallback finishedCallback,
SurfaceControl.Transaction t) {
mStageCoordinator.updateSurfaceBounds(null /* layout */, t);
if (apps != null) {
for (int i = 0; i < apps.length; ++i) {
if (apps[i].mode == MODE_OPENING) {
t.show(apps[i].leash);
}
}
if (apps == null || apps.length == 0) {
// Do nothing when the animation was cancelled.
t.apply();
return;
}
mStageCoordinator.updateSurfaceBounds(null /* layout */, t);
for (int i = 0; i < apps.length; ++i) {
if (apps[i].mode == MODE_OPENING) {
t.show(apps[i].leash);
}
}
t.apply();
if (finishedCallback != null) {
try {
finishedCallback.onAnimationFinished();