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

Commit d2a38c78 authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Ignore finishing activities when fetching the top" into lmp-dev

parents 214e7ad1 0175b882
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
@@ -1772,7 +1772,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) {