Merge "Fix SystemUI crash from continues launch task with setLaunchRootTask" into udc-dev am: 61730e62dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23577584 Change-Id: Ib11a72256dd70b220dccd1b9749c77a4a0ffc886 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -3310,9 +3310,14 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
if (aOptions != null) {
|
if (aOptions != null) {
|
||||||
// Resolve the root task the task should be placed in now based on options
|
// Resolve the root task the task should be placed in now based on options
|
||||||
// and reparent if needed.
|
// and reparent if needed.
|
||||||
|
// TODO(b/229927851) For split-screen, setLaunchRootTask is no longer the "root"
|
||||||
|
// task, consider to rename methods like "parentTask" instead of "rootTask".
|
||||||
final Task targetRootTask =
|
final Task targetRootTask =
|
||||||
getOrCreateRootTask(null, aOptions, task, onTop);
|
getOrCreateRootTask(null, aOptions, task, onTop);
|
||||||
if (targetRootTask != null && task.getRootTask() != targetRootTask) {
|
// When launch with ActivityOptions#getLaunchRootTask, the "root task" just mean the
|
||||||
|
// parent of current launch, not the "root task" in hierarchy.
|
||||||
|
if (targetRootTask != null && task.getRootTask() != targetRootTask
|
||||||
|
&& task.getParent() != targetRootTask) {
|
||||||
final int reparentMode = onTop
|
final int reparentMode = onTop
|
||||||
? REPARENT_MOVE_ROOT_TASK_TO_FRONT : REPARENT_LEAVE_ROOT_TASK_IN_PLACE;
|
? REPARENT_MOVE_ROOT_TASK_TO_FRONT : REPARENT_LEAVE_ROOT_TASK_IN_PLACE;
|
||||||
task.reparent(targetRootTask, onTop, reparentMode, ANIMATE, DEFER_RESUME,
|
task.reparent(targetRootTask, onTop, reparentMode, ANIMATE, DEFER_RESUME,
|
||||||
|
|||||||
Reference in New Issue
Block a user