From 97eb471f2efda1eccce7eba8c68301b2fa34c5e7 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Mon, 26 Jun 2023 12:23:08 +0000 Subject: [PATCH] Prevent exception when quick switching between two split pairs When switching in between two split pairs just quick enough, it is possible to send the second entering split transition while it is animating the first entering split transition which is merged to a recents-during-split transition. The split parents might not be collected into the second transition because the split parents are already visible at that time, and there is no recents transition to merge to. So updates to not throwing when there is no split parent when composing a recents-to-split animation. Bug: 236226779 Test: repro steps of the bug and the Launcher won't throw Change-Id: I3a595722721186e8de7d60c9fb8c099ec799804a --- quickstep/src/com/android/quickstep/TaskViewUtils.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/TaskViewUtils.java b/quickstep/src/com/android/quickstep/TaskViewUtils.java index 499a2601a9..1238819acd 100644 --- a/quickstep/src/com/android/quickstep/TaskViewUtils.java +++ b/quickstep/src/com/android/quickstep/TaskViewUtils.java @@ -473,16 +473,14 @@ public final class TaskViewUtils { throw new IllegalStateException( "Expected task to be showing, but it is " + mode); } - if (change.getParent() == null) { - throw new IllegalStateException("Initiating multi-split launch but the split" - + "root of " + taskId + " is already visible or has broken hierarchy."); - } } if (taskId == initialTaskId) { - splitRoot1 = transitionInfo.getChange(change.getParent()); + splitRoot1 = change.getParent() == null ? change : + transitionInfo.getChange(change.getParent()); } if (taskId == secondTaskId) { - splitRoot2 = transitionInfo.getChange(change.getParent()); + splitRoot2 = change.getParent() == null ? change : + transitionInfo.getChange(change.getParent()); } }