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

Commit 528a3a2e authored by Stefan Kuhne's avatar Stefan Kuhne Committed by Android Git Automerger
Browse files

am 242a5004: Merge "Don\'t exceed max. allowed recent document tasks for an app." into mnc-dev

* commit '242a5004':
  Don't exceed max. allowed recent document tasks for an app.
parents 7a484032 242a5004
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -435,9 +435,7 @@ class RecentTasks extends ArrayList<TaskRecord> {
     */
    int trimForTaskLocked(TaskRecord task, boolean doTrim) {
        int recentsCount = size();
        final Intent intent = task.intent;
        final boolean document = intent != null && intent.isDocument();

        final boolean document = task.intent != null && task.intent.isDocument();
        int maxRecents = task.maxRecents - 1;
        for (int i = 0; i < recentsCount; i++) {
            final TaskRecord tr = get(i);
@@ -448,12 +446,11 @@ class RecentTasks extends ArrayList<TaskRecord> {
                if (i > MAX_RECENT_BITMAPS) {
                    tr.freeLastThumbnail();
                }
                final Intent trIntent = tr.intent;
                if ((task.affinity == null || !task.affinity.equals(tr.affinity)) &&
                        (intent == null || !intent.filterEquals(trIntent))) {
                if (task.realActivity == null || tr.realActivity == null ||
                        !task.realActivity.equals(tr.realActivity)) {
                    continue;
                }
                final boolean trIsDocument = trIntent != null && trIntent.isDocument();
                final boolean trIsDocument = tr.intent != null && tr.intent.isDocument();
                if (document && trIsDocument) {
                    // These are the same document activity (not necessarily the same doc).
                    if (maxRecents > 0) {