Merge "Bring task to front when we can't move to adjacent stack" into nyc-dev

This commit is contained in:
Andrii Kulian
2016-06-16 21:30:21 +00:00
committed by Android (Google) Code Review

View File

@@ -1465,14 +1465,23 @@ class ActivityStarter {
intentActivity.task, mNoAnimation, mOptions, intentActivity.task, mNoAnimation, mOptions,
mStartActivity.appTimeTracker, "bringingFoundTaskToFront"); mStartActivity.appTimeTracker, "bringingFoundTaskToFront");
mMovedToFront = true; mMovedToFront = true;
} else if ((launchStack.mStackId == DOCKED_STACK_ID } else if (launchStack.mStackId == DOCKED_STACK_ID
|| launchStack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) || launchStack.mStackId == FULLSCREEN_WORKSPACE_STACK_ID) {
&& (mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) { if ((mLaunchFlags & FLAG_ACTIVITY_LAUNCH_ADJACENT) != 0) {
// If we want to launch adjacent and mTargetStack is not the computed // If we want to launch adjacent and mTargetStack is not the computed
// launch stack - move task to top of computed stack. // launch stack - move task to top of computed stack.
mSupervisor.moveTaskToStackLocked(intentActivity.task.taskId, mSupervisor.moveTaskToStackLocked(intentActivity.task.taskId,
launchStack.mStackId, ON_TOP, FORCE_FOCUS, "launchToSide", launchStack.mStackId, ON_TOP, FORCE_FOCUS, "launchToSide",
ANIMATE); ANIMATE);
} else {
// TODO: This should be reevaluated in MW v2.
// We choose to move task to front instead of launching it adjacent
// when specific stack was requested explicitly and it appeared to be
// adjacent stack, but FLAG_ACTIVITY_LAUNCH_ADJACENT was not set.
mTargetStack.moveTaskToFrontLocked(intentActivity.task, mNoAnimation,
mOptions, mStartActivity.appTimeTracker,
"bringToFrontInsteadOfAdjacentLaunch");
}
mMovedToFront = true; mMovedToFront = true;
} }
mOptions = null; mOptions = null;