diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-06-26 20:58:23 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-26 20:58:29 +0000 |
| commit | c4e8720eb2b5f7230003f2ae03f06337483afec7 (patch) | |
| tree | 13727409edec16a868fbbe91a3752c1197267a46 /core/java/android | |
| parent | a350db60bdcd0e05613466739dc6d41cd1caf639 (diff) | |
| parent | a9dca2483e9f37098c9fe29415b28184b402aa5e (diff) | |
Merge "Log sync details to rotating log files (userdebug/eng only)" into oc-dr1-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/FileUtils.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java index 50b4f8c7facf..56d6e0a62f94 100644 --- a/core/java/android/os/FileUtils.java +++ b/core/java/android/os/FileUtils.java @@ -369,11 +369,11 @@ public class FileUtils { * constraints remain. * * @param minCount Always keep at least this many files. - * @param minAge Always keep files younger than this age. + * @param minAgeMs Always keep files younger than this age, in milliseconds. * @return if any files were deleted. */ - public static boolean deleteOlderFiles(File dir, int minCount, long minAge) { - if (minCount < 0 || minAge < 0) { + public static boolean deleteOlderFiles(File dir, int minCount, long minAgeMs) { + if (minCount < 0 || minAgeMs < 0) { throw new IllegalArgumentException("Constraints must be positive or 0"); } @@ -393,9 +393,9 @@ public class FileUtils { for (int i = minCount; i < files.length; i++) { final File file = files[i]; - // Keep files newer than minAge + // Keep files newer than minAgeMs final long age = System.currentTimeMillis() - file.lastModified(); - if (age > minAge) { + if (age > minAgeMs) { if (file.delete()) { Log.d(TAG, "Deleted old file " + file); deleted = true; |
