summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/am/TaskRecord.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 4de73675db02..b8c29a0c0b88 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -784,18 +784,19 @@ final class TaskRecord {
}
int findEffectiveRootIndex() {
- int activityNdx;
+ int effectiveNdx = 0;
final int topActivityNdx = mActivities.size() - 1;
- for (activityNdx = 0; activityNdx < topActivityNdx; ++activityNdx) {
+ for (int activityNdx = 0; activityNdx < topActivityNdx; ++activityNdx) {
final ActivityRecord r = mActivities.get(activityNdx);
if (r.finishing) {
continue;
}
+ effectiveNdx = activityNdx;
if ((r.info.flags & ActivityInfo.FLAG_RELINQUISH_TASK_IDENTITY) == 0) {
break;
}
}
- return activityNdx;
+ return effectiveNdx;
}
void updateEffectiveIntent() {