From 0e829258a2f611549b5214af5f5e122cce711884 Mon Sep 17 00:00:00 2001 From: "pioush.kumar-IN009423" Date: Thu, 15 Dec 2022 11:08:31 +0530 Subject: 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 Change-Id: I19748f8128d1a3f4eac4dae0d9b7cfd99e5e835c Signed-off-by: pioush.kumar-IN009423 --- services/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 ff09163c151d..330c09876e1e 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -1085,10 +1085,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; -- cgit v1.2.3-59-g8ed1b