Merge "Fixed issue with moveTaskToBack on single stack devices" into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e43d43c391
@@ -3740,7 +3740,12 @@ final class ActivityStack {
|
|||||||
if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId);
|
if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId);
|
||||||
|
|
||||||
boolean prevIsHome = false;
|
boolean prevIsHome = false;
|
||||||
if (tr.isOverHomeStack()) {
|
|
||||||
|
// If true, we should resume the home activity next if the task we are moving to the
|
||||||
|
// back is over the home stack. We force to false if the task we are moving to back
|
||||||
|
// is the home task and we don't want it resumed after moving to the back.
|
||||||
|
final boolean canGoHome = !tr.isHomeTask() && tr.isOverHomeStack();
|
||||||
|
if (canGoHome) {
|
||||||
final TaskRecord nextTask = getNextTask(tr);
|
final TaskRecord nextTask = getNextTask(tr);
|
||||||
if (nextTask != null) {
|
if (nextTask != null) {
|
||||||
nextTask.setTaskToReturnTo(tr.getTaskToReturnTo());
|
nextTask.setTaskToReturnTo(tr.getTaskToReturnTo());
|
||||||
@@ -3774,8 +3779,7 @@ final class ActivityStack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final TaskRecord task = mResumedActivity != null ? mResumedActivity.task : null;
|
final TaskRecord task = mResumedActivity != null ? mResumedActivity.task : null;
|
||||||
if (prevIsHome || task == tr && tr.isOverHomeStack()
|
if (prevIsHome || (task == tr && canGoHome) || (numTasks <= 1 && isOnHomeDisplay())) {
|
||||||
|| numTasks <= 1 && isOnHomeDisplay()) {
|
|
||||||
if (!mService.mBooting && !mService.mBooted) {
|
if (!mService.mBooting && !mService.mBooted) {
|
||||||
// Not ready yet!
|
// Not ready yet!
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user