Merge "[ActivityManager] Fix index OOB when resetting removed task"

This commit is contained in:
Craig Mautner
2015-03-11 13:46:37 +00:00
committed by Gerrit Code Review

View File

@@ -2445,9 +2445,11 @@ final class ActivityStack {
} }
int taskNdx = mTaskHistory.indexOf(task); int taskNdx = mTaskHistory.indexOf(task);
do { if (taskNdx >= 0) {
taskTop = mTaskHistory.get(taskNdx--).getTopActivity(); do {
} while (taskTop == null && taskNdx >= 0); taskTop = mTaskHistory.get(taskNdx--).getTopActivity();
} while (taskTop == null && taskNdx >= 0);
}
if (topOptions != null) { if (topOptions != null) {
// If we got some ActivityOptions from an activity on top that // If we got some ActivityOptions from an activity on top that