Do not move home when starting recent task from non-recents
The move-home case is only needed when using 3rd-party launcher.
I.e. RecentsActivity will be used. Such as quick switch to app on home.
The stack will be home->recents->app. Then after going back from app,
it should be home instead of recents.
Since the WindowContainerTransaction#startTask also uses
startActivityFromRecents, the caller can be systemui (not recents).
And it only wants to move the task to front without moving home.
Bug: 345186561
Flag: EXEMPT bugfix
Test: Assume Task1 and Task2 belong to a test app.
Launch Task1. Return to home. Launch Task2.
Task2 starts Task1 by startActivityFromRecents.
Press back key. The next should be Task2 instead of home.
Change-Id: I6219614ae46291db8b6cdd3be795a1262931b6b1
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index d65a106..00b6453 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -2737,9 +2737,9 @@
final ActivityOptions activityOptions = options != null
? options.getOptions(this)
: null;
- boolean moveHomeTaskForward = true;
synchronized (mService.mGlobalLock) {
final boolean isCallerRecents = mRecentTasks.isCallerRecents(callingUid);
+ boolean moveHomeTaskForward = isCallerRecents;
int activityType = ACTIVITY_TYPE_UNDEFINED;
if (activityOptions != null) {
activityType = activityOptions.getLaunchActivityType();