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

Commit 07636602 authored by Michael Bestas's avatar Michael Bestas Committed by Gerrit Code Review
Browse files

Revert "[ActivityManager] Improve task order of getRunningTasks."

This reverts commit 676a5b43.

Change-Id: Ib8d9bce237267e024d597a5eb573e5d7880e02d2
parent 487ee1ed
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -3996,18 +3996,16 @@ final class ActivityStack {
    }

    void getTasksLocked(List<RunningTaskInfo> list, int callingUid, boolean allowed) {
        boolean setFirstAsLast = mStackSupervisor.getFocusedStack() == this;
        boolean first = true;
        for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) {
            final TaskRecord task = mTaskHistory.get(taskNdx);
            if (task.getTopActivity() == null) {
                continue;
            }
            ActivityRecord r = null;
            ActivityRecord top = null;
            int numActivities = 0;
            int numRunning = 0;
            final ArrayList<ActivityRecord> activities = task.mActivities;
            if (activities.isEmpty()) {
                continue;
            }
            if (!allowed && !task.isHomeTask() && task.effectiveUid != callingUid) {
                continue;
            }
@@ -4036,10 +4034,6 @@ final class ActivityStack {
            ci.baseActivity = r.intent.getComponent();
            ci.topActivity = top.intent.getComponent();
            ci.lastActiveTime = task.lastActiveTime;
            if (setFirstAsLast && first) {
                ci.lastActiveTime = SystemClock.elapsedRealtime();
                first = false;
            }

            if (top.task != null) {
                ci.description = top.task.lastDescription;