Merge "Don't update task to return to type for last task over home" into nyc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fc20505e37
@@ -2587,11 +2587,14 @@ final class ActivityStack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void insertTaskAtTop(TaskRecord task, ActivityRecord newActivity) {
|
private void insertTaskAtTop(TaskRecord task, ActivityRecord newActivity) {
|
||||||
|
boolean isLastTaskOverHome = false;
|
||||||
// If the moving task is over home stack, transfer its return type to next task
|
// If the moving task is over home stack, transfer its return type to next task
|
||||||
if (task.isOverHomeStack()) {
|
if (task.isOverHomeStack()) {
|
||||||
final TaskRecord nextTask = getNextTask(task);
|
final TaskRecord nextTask = getNextTask(task);
|
||||||
if (nextTask != null) {
|
if (nextTask != null) {
|
||||||
nextTask.setTaskToReturnTo(task.getTaskToReturnTo());
|
nextTask.setTaskToReturnTo(task.getTaskToReturnTo());
|
||||||
|
} else {
|
||||||
|
isLastTaskOverHome = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2601,7 +2604,10 @@ final class ActivityStack {
|
|||||||
ActivityStack lastStack = mStackSupervisor.getLastStack();
|
ActivityStack lastStack = mStackSupervisor.getLastStack();
|
||||||
final boolean fromHome = lastStack.isHomeStack();
|
final boolean fromHome = lastStack.isHomeStack();
|
||||||
if (!isHomeStack() && (fromHome || topTask() != task)) {
|
if (!isHomeStack() && (fromHome || topTask() != task)) {
|
||||||
int returnToType = APPLICATION_ACTIVITY_TYPE;
|
// If it's a last task over home - we default to keep its return to type not to
|
||||||
|
// make underlying task focused when this one will be finished.
|
||||||
|
int returnToType = isLastTaskOverHome
|
||||||
|
? task.getTaskToReturnTo() : APPLICATION_ACTIVITY_TYPE;
|
||||||
if (fromHome && StackId.allowTopTaskToReturnHome(mStackId)) {
|
if (fromHome && StackId.allowTopTaskToReturnHome(mStackId)) {
|
||||||
returnToType = lastStack.topTask() == null
|
returnToType = lastStack.topTask() == null
|
||||||
? HOME_ACTIVITY_TYPE : lastStack.topTask().taskType;
|
? HOME_ACTIVITY_TYPE : lastStack.topTask().taskType;
|
||||||
|
|||||||
@@ -1121,7 +1121,11 @@ class ActivityStarter {
|
|||||||
return START_RETURN_LOCK_TASK_MODE_VIOLATION;
|
return START_RETURN_LOCK_TASK_MODE_VIOLATION;
|
||||||
}
|
}
|
||||||
if (!mMovedOtherTask) {
|
if (!mMovedOtherTask) {
|
||||||
updateTaskReturnToType(mStartActivity.task, mLaunchFlags, topStack);
|
// If stack id is specified in activity options, usually it means that activity is
|
||||||
|
// launched not from currently focused stack (e.g. from SysUI or from shell) - in
|
||||||
|
// that case we check the target stack.
|
||||||
|
updateTaskReturnToType(mStartActivity.task, mLaunchFlags,
|
||||||
|
preferredLaunchStackId != INVALID_STACK_ID ? mTargetStack : topStack);
|
||||||
}
|
}
|
||||||
} else if (mSourceRecord != null) {
|
} else if (mSourceRecord != null) {
|
||||||
if (mSupervisor.isLockTaskModeViolation(mSourceRecord.task)) {
|
if (mSupervisor.isLockTaskModeViolation(mSourceRecord.task)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user