summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2015-08-11 13:54:42 -0700
committerWale Ogunwale <ogunwale@google.com>2015-08-11 13:54:42 -0700
commit4270924801c312399bd72ac35eb95f16ed7167e6 (patch)
tree4f9c358727ac16c55b4b3735baf4996354deda29 /services
parentad7719dea4e8fd34854e4dcc918fc593c4416d82 (diff)
downloadframeworks_base-4270924801c312399bd72ac35eb95f16ed7167e6.zip
frameworks_base-4270924801c312399bd72ac35eb95f16ed7167e6.tar.gz
frameworks_base-4270924801c312399bd72ac35eb95f16ed7167e6.tar.bz2
Fixed issue with moveTaskToBack on single stack devices
Icdad980eec64e081d15679600da07cf4431e40d6 allowed us to properly return to the home acitvity when a task is moved to back. However, this improperly moved the home task to the front if it is the task we are moving to the back on a single stack device. We now prevent the movement of the home task to the front from happening. Bug: 23088310 Change-Id: Ic21779cdb2d2007671d212d41fab5e68be2ae632
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index a75cc48..6e34876 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -3740,7 +3740,12 @@ final class ActivityStack {
if (DEBUG_TRANSITION) Slog.v(TAG_TRANSITION, "Prepare to back transition: task=" + taskId);
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);
if (nextTask != null) {
nextTask.setTaskToReturnTo(tr.getTaskToReturnTo());
@@ -3774,8 +3779,7 @@ final class ActivityStack {
}
final TaskRecord task = mResumedActivity != null ? mResumedActivity.task : null;
- if (prevIsHome || task == tr && tr.isOverHomeStack()
- || numTasks <= 1 && isOnHomeDisplay()) {
+ if (prevIsHome || (task == tr && canGoHome) || (numTasks <= 1 && isOnHomeDisplay())) {
if (!mService.mBooting && !mService.mBooted) {
// Not ready yet!
return false;