Merge "Put launch adjacent activity in a new task if the activity does exist" into nyc-dev am: a781232656

am: 6c7ea25a2b

* commit '6c7ea25a2b3f219dd3fe540fd97ee10ac5f2d77d':
  Put launch adjacent activity in a new task if the activity does exist

Change-Id: I45083d8f83d59ab12d30c171707cc091afe0bfa9
This commit is contained in:
Wale Ogunwale
2016-05-20 17:31:58 +00:00
committed by android-build-merger

View File

@@ -1396,11 +1396,18 @@ class ActivityStarter {
final TaskRecord task = mSupervisor.anyTaskForIdLocked(mOptions.getLaunchTaskId());
intentActivity = task != null ? task.getTopActivity() : null;
} else if (putIntoExistingTask) {
// See if there is a task to bring to the front. If this is a SINGLE_INSTANCE
// activity, there can be one and only one instance of it in the history, and it is
// always in its own unique task, so we do a special search.
intentActivity = mLaunchSingleInstance ? mSupervisor.findActivityLocked(mIntent, mStartActivity.info)
: mSupervisor.findTaskLocked(mStartActivity);
if (mLaunchSingleInstance) {
// There can be one and only one instance of single instance activity in the
// history, and it is always in its own unique task, so we do a special search.
intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info);
} else if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) {
// For the launch adjacent case we only want to put the activity in an existing
// task if the activity already exists in the history.
intentActivity = mSupervisor.findActivityLocked(mIntent, mStartActivity.info);
} else {
// Otherwise find the best task to put the activity in.
intentActivity = mSupervisor.findTaskLocked(mStartActivity);
}
}
return intentActivity;
}