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

Commit 69de46ba authored by Elliott Hughes's avatar Elliott Hughes Committed by Automerger Merge Worker
Browse files

Merge "maybePruneOldTraces: bail if modification times change." am: 9144eaf1 am: 72d2a3f7

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

Change-Id: I0d2b0d8ee552e268980a69c5e9548529e8adad84
parents 3dc165f5 72d2a3f7
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -3287,6 +3287,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        final int max = SystemProperties.getInt("tombstoned.max_anr_count", 64);
        final long now = System.currentTimeMillis();
        try {
            Arrays.sort(files, Comparator.comparingLong(File::lastModified).reversed());
            for (int i = 0; i < files.length; ++i) {
                if (i > max || (now - files[i].lastModified()) > DAY_IN_MILLIS) {
@@ -3295,6 +3296,11 @@ public class ActivityManagerService extends IActivityManager.Stub
                    }
                }
            }
        } catch (IllegalArgumentException e) {
            // The modification times changed while we were sorting. Bail...
            // https://issuetracker.google.com/169836837
            Slog.w(TAG, "tombstone modification times changed while sorting; not pruning", e);
        }
    }
    /**