summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-04-14 18:01:43 -0700
committerDianne Hackborn <hackbod@google.com>2010-04-14 18:01:43 -0700
commitb67fa45c26d5e4fc4d19a15868af348994bd6287 (patch)
treeb99fd4aa49cf975ce4f913fba8cd8f98fdb61eaf /services
parent8a878dde9d15f75446bb5ca3137fccef8426ddd7 (diff)
downloadframeworks_base-b67fa45c26d5e4fc4d19a15868af348994bd6287.zip
frameworks_base-b67fa45c26d5e4fc4d19a15868af348994bd6287.tar.gz
frameworks_base-b67fa45c26d5e4fc4d19a15868af348994bd6287.tar.bz2
Fix issue #258640: Automatic propagation of FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
Make sure, if an activity is started with clear task when reset, if that activity is finished in the middle of a stack that the behavior is retained by propagating it to the next activity. Change-Id: Ie31b8f968558b0e64e0ef7efa55950a722c6afa5
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 1486a1d..13690bc 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -4078,10 +4078,19 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
System.identityHashCode(r),
r.task.taskId, r.shortComponentName, reason);
r.task.numActivities--;
- if (r.frontOfTask && index < (mHistory.size()-1)) {
+ if (index < (mHistory.size()-1)) {
HistoryRecord next = (HistoryRecord)mHistory.get(index+1);
if (next.task == r.task) {
- next.frontOfTask = true;
+ if (r.frontOfTask) {
+ // The next activity is now the front of the task.
+ next.frontOfTask = true;
+ }
+ if ((r.intent.getFlags()&Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) != 0) {
+ // If the caller asked that this activity (and all above it)
+ // be cleared when the task is reset, don't lose that information,
+ // but propagate it up to the next activity.
+ next.intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
+ }
}
}