diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 3b43e48a53af..447a6b05a48a 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -2722,6 +2722,17 @@ class ActivityStarter { mTargetRootTask = intentActivity.getRootTask(); mSupervisor.handleNonResizableTaskIfNeeded(intentTask, WINDOWING_MODE_UNDEFINED, mRootWindowContainer.getDefaultTaskDisplayArea(), mTargetRootTask); + + // We need to check if there is a launch root task in TDA for this target root task. + // If it exist, we need to reparent target root task from TDA to launch root task. + final TaskDisplayArea tda = mTargetRootTask.getDisplayArea(); + final Task launchRootTask = tda.getLaunchRootTask(mTargetRootTask.getWindowingMode(), + mTargetRootTask.getActivityType(), null /** options */, null /** sourceTask */, + 0 /** launchFlags */); + if (launchRootTask != null && launchRootTask != mTargetRootTask) { + mTargetRootTask.reparent(launchRootTask, POSITION_TOP); + mTargetRootTask = launchRootTask; + } } private void resumeTargetRootTaskIfNeeded() { |