Ignore finishing activities when fetching the top

When the top activity is finishing we don't want to be comparing
it for matches to launching activities. This was keeping curTop
from matching itself when launching a lower task.

Fixes bug 17383648.

Change-Id: I837ac087ef965d99d12c98ab1c779de46716e204
This commit is contained in:
Craig Mautner
2014-09-07 18:05:31 -07:00
parent 68c936f77d
commit 0175b882b5
2 changed files with 6 additions and 6 deletions

View File

@@ -425,13 +425,13 @@ final class ActivityStack {
}
final ActivityRecord topActivity() {
// Iterate to find the first non-empty task stack. Note that this code can
// be simplified once we stop storing tasks with empty mActivities lists.
for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
ArrayList<ActivityRecord> activities = mTaskHistory.get(taskNdx).mActivities;
final int topActivityNdx = activities.size() - 1;
if (topActivityNdx >= 0) {
return activities.get(topActivityNdx);
for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {
final ActivityRecord r = activities.get(activityNdx);
if (!r.finishing) {
return r;
}
}
}
return null;

View File

@@ -1768,7 +1768,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
if (intentActivity != null) {
if (isLockTaskModeViolation(intentActivity.task)) {
showLockTaskToast();
Slog.e(TAG, "moveTaskToFront: Attempt to violate Lock Task Mode");
Slog.e(TAG, "startActivityUnchecked: Attempt to violate Lock Task Mode");
return ActivityManager.START_RETURN_LOCK_TASK_MODE_VIOLATION;
}
if (r.task == null) {