Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0175b882 authored by Craig Mautner's avatar Craig Mautner
Browse files

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
parent 68c936f7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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) {