diff options
| author | 2021-02-05 10:05:16 +0000 | |
|---|---|---|
| committer | 2021-02-05 10:05:16 +0000 | |
| commit | 38e2107006034c93aa357f61ba86a93aa9c3aff2 (patch) | |
| tree | 37a697b5ab35f34d25c8ced57b694e08f54577a7 | |
| parent | 5759b004f8441b5c411ba00a70fc581c4201c4b3 (diff) | |
| parent | f714906c48119413fbf864b0bc00589e9088e523 (diff) | |
Merge "Avoid creating new instance when started for result with singleInstance/singleTask" into sc-dev
| -rw-r--r-- | services/core/java/com/android/server/wm/ActivityStarter.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java index d846c3a6d36c..79f8229c6162 100644 --- a/services/core/java/com/android/server/wm/ActivityStarter.java +++ b/services/core/java/com/android/server/wm/ActivityStarter.java @@ -1814,8 +1814,7 @@ class ActivityStarter { } private Task computeTargetTask() { - if (mStartActivity.resultTo == null && mInTask == null && !mAddingToTask - && (mLaunchFlags & FLAG_ACTIVITY_NEW_TASK) != 0) { + if (mInTask == null && !mAddingToTask && (mLaunchFlags & FLAG_ACTIVITY_NEW_TASK) != 0) { // A new task should be created instead of using existing one. return null; } else if (mSourceRecord != null) { @@ -2505,7 +2504,9 @@ class ActivityStarter { // If bring to front is requested, and no result is requested and we have not been given // an explicit task to launch in to, and we can find a task that was started with this // same component, then instead of launching bring that one to the front. - putIntoExistingTask &= mInTask == null && mStartActivity.resultTo == null; + putIntoExistingTask &= !isLaunchModeOneOf(LAUNCH_SINGLE_INSTANCE, LAUNCH_SINGLE_TASK) + ? (mInTask == null && mStartActivity.resultTo == null) + : (mInTask == null); ActivityRecord intentActivity = null; if (putIntoExistingTask) { if (LAUNCH_SINGLE_INSTANCE == mLaunchMode) { |