diff options
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStack.java | 9 | ||||
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 5 |
2 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java index a8eaaa4c2438..a09d3c8fc4f2 100644 --- a/services/core/java/com/android/server/wm/ActivityStack.java +++ b/services/core/java/com/android/server/wm/ActivityStack.java @@ -834,11 +834,12 @@ class ActivityStack extends ConfigurationContainer { // so that the divider matches and remove this logic. // TODO: This is currently only called when entering split-screen while in another // task, and from the tests - // TODO (b/78247419): Check if launcher and overview are same then move home stack - // instead of recents stack. Then fix the rotation animation from fullscreen to - // minimized mode + // TODO (b/78247419): Fix the rotation animation from fullscreen to minimized mode + final boolean isRecentsComponentHome = + mService.getRecentTasks().isRecentsComponentHomeActivity(mCurrentUser); final ActivityStack recentStack = display.getOrCreateStack( - WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, ACTIVITY_TYPE_RECENTS, + WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, + isRecentsComponentHome ? ACTIVITY_TYPE_HOME : ACTIVITY_TYPE_RECENTS, true /* onTop */); recentStack.moveToFront("setWindowingMode"); // If task moved to docked stack - show recents if needed. diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index 5717e2fa02d2..66ebe097695b 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -2337,7 +2337,12 @@ class ActivityStarter { REPARENT_MOVE_STACK_TO_FRONT, ANIMATE, DEFER_RESUME, "reparentingHome"); mMovedToFront = true; + } else if (launchStack.topTask() == null) { + // The task does not need to be reparented to the launch stack. Remove the + // launch stack if there is no activity in it. + launchStack.remove(); } + mOptions = null; // We are moving a task to the front, use starting window to hide initial drawn |