Return more information when getAppTasks#getTaskInfo is called.
The RecentTaskInfo object returned when getAppTasks#getTaskInfo
is called now contains baseActivity, topActivity, and numActivities.
Bug: 18723935
Change-Id: Ifc0cd68a57ed2c0823c23ac8d27e3b6ea6bc95e2
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 6210d60..fa22a30 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -4061,6 +4061,7 @@
}
ActivityRecord r = null;
ActivityRecord top = null;
+ ActivityRecord tmp;
int numActivities = 0;
int numRunning = 0;
final ArrayList<ActivityRecord> activities = task.mActivities;
@@ -4068,7 +4069,11 @@
continue;
}
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
- r = activities.get(activityNdx);
+ tmp = activities.get(activityNdx);
+ if (tmp.finishing) {
+ continue;
+ }
+ r = tmp;
// Initialize state for next task if needed.
if (top == null || (top.state == ActivityState.INITIALIZING)) {