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

Commit bd8bd00b authored by William McVicker's avatar William McVicker Committed by Automerger Merge Worker
Browse files

Merge "Fix the same active time tasks disappeared on RunngintTasks" am: e55bd160 am: a5125067

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2007631

Change-Id: I1f6e98429e4c981ac456e99e51111c1454b7065f
parents 2769a48e a5125067
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -43,7 +43,11 @@ class RunningTasks {

    // Comparator to sort by last active time (descending)
    private static final Comparator<Task> LAST_ACTIVE_TIME_COMPARATOR =
            (o1, o2) -> Long.signum(o2.lastActiveTime - o1.lastActiveTime);
            (o1, o2) -> {
                return o1.lastActiveTime == o2.lastActiveTime
                        ? Integer.signum(o2.mTaskId - o1.mTaskId) :
                        Long.signum(o2.lastActiveTime - o1.lastActiveTime);
            };

    private final TreeSet<Task> mTmpSortedSet = new TreeSet<>(LAST_ACTIVE_TIME_COMPARATOR);