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

Commit 9144eaf1 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "maybePruneOldTraces: bail if modification times change."

parents 4c656038 0023356f
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -4060,6 +4060,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) {
@@ -4068,6 +4069,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);
        }
    }
    /**