diff options
author | Craig Mautner <cmautner@google.com> | 2013-11-11 18:01:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-11 18:01:36 +0000 |
commit | 8cfa6d083bc5638801fa6d1b2dfccbc460c88bb9 (patch) | |
tree | caadc2d32db5980e8d84ead1ab497c4b94b8a43b /services/java | |
parent | e45d8b2dab33de18bef5cc5ae7db37b890b22d8d (diff) | |
parent | 8862929e2a5ae4936083b6d7ac7e908df256a885 (diff) | |
download | frameworks_base-8cfa6d083bc5638801fa6d1b2dfccbc460c88bb9.zip frameworks_base-8cfa6d083bc5638801fa6d1b2dfccbc460c88bb9.tar.gz frameworks_base-8cfa6d083bc5638801fa6d1b2dfccbc460c88bb9.tar.bz2 |
Merge "Use old task info when creating new task." into klp-dev
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/am/ActivityStackSupervisor.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/services/java/com/android/server/am/ActivityStackSupervisor.java b/services/java/com/android/server/am/ActivityStackSupervisor.java index 8251364..483b4a0 100644 --- a/services/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/java/com/android/server/am/ActivityStackSupervisor.java @@ -1386,17 +1386,22 @@ public final class ActivityStackSupervisor { launchFlags |= Intent.FLAG_ACTIVITY_NEW_TASK; } + ActivityInfo newTaskInfo = null; + Intent newTaskIntent = null; final ActivityStack sourceStack; if (sourceRecord != null) { if (sourceRecord.finishing) { // If the source is finishing, we can't further count it as our source. This // is because the task it is associated with may now be empty and on its way out, // so we don't want to blindly throw it in to that task. Instead we will take - // the NEW_TASK flow and try to find a task for it. + // the NEW_TASK flow and try to find a task for it. But save the task information + // so it can be used when creating the new task. if ((launchFlags&Intent.FLAG_ACTIVITY_NEW_TASK) == 0) { Slog.w(TAG, "startActivity called from finishing " + sourceRecord + "; forcing " + "Intent.FLAG_ACTIVITY_NEW_TASK for: " + intent); launchFlags |= Intent.FLAG_ACTIVITY_NEW_TASK; + newTaskInfo = sourceRecord.info; + newTaskIntent = sourceRecord.task.intent; } sourceRecord = null; sourceStack = null; @@ -1668,8 +1673,10 @@ public final class ActivityStackSupervisor { targetStack = adjustStackFocus(r); moveHomeStack(targetStack.isHomeStack()); if (reuseTask == null) { - r.setTask(targetStack.createTaskRecord(getNextTaskId(), r.info, intent, true), - null, true); + r.setTask(targetStack.createTaskRecord(getNextTaskId(), + newTaskInfo != null ? newTaskInfo : r.info, + newTaskIntent != null ? newTaskIntent : intent, + true), null, true); if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r + " in new task " + r.task); } else { |