From 93d6b593b041f3e316ae1dccd21fc6137afc55e5 Mon Sep 17 00:00:00 2001 From: "pioush.kumar-IN009423" Date: Thu, 15 Dec 2022 11:08:31 +0530 Subject: [PATCH] Skype is not opening in full screen Problem: { 1. Skype is using flag adjacent launch in this issue while starting the activity. 2. Skype unable to open in full screen after split screen dismissed. 3. Skype is being to multi window. without any prior task present. 4. But its states are not properly set. Causing this issue. } Solution: { 1. Also if source task and candidate task are equal do nothing. 2. This means task that is starting new activity is itself. } Bug: 262643393 Test: pass existing tests Merged-In: I19748f8128d1a3f4eac4dae0d9b7cfd99e5e835c Change-Id: I19748f8128d1a3f4eac4dae0d9b7cfd99e5e835c Signed-off-by: pioush.kumar-IN009423 --- .../core/java/com/android/server/wm/TaskDisplayArea.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index 8ad76a3eb3271..79be9463aa05b 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -1074,10 +1074,14 @@ final class TaskDisplayArea extends DisplayArea { // Use launch-adjacent-flag-root if launching with launch-adjacent flag. if ((launchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0 && mLaunchAdjacentFlagRootTask != null) { - // If the adjacent launch is coming from the same root, launch to adjacent root instead. - if (sourceTask != null && mLaunchAdjacentFlagRootTask.getAdjacentTaskFragment() != null + if (sourceTask != null && sourceTask == candidateTask) { + // Do nothing when task that is getting opened is same as the source. + } else if (sourceTask != null + && mLaunchAdjacentFlagRootTask.getAdjacentTaskFragment() != null && (sourceTask == mLaunchAdjacentFlagRootTask || sourceTask.isDescendantOf(mLaunchAdjacentFlagRootTask))) { + // If the adjacent launch is coming from the same root, launch to + // adjacent root instead. return mLaunchAdjacentFlagRootTask.getAdjacentTaskFragment().asTask(); } else { return mLaunchAdjacentFlagRootTask;