From 0b2c2e4692bc62244ffce642f4c442076eda6767 Mon Sep 17 00:00:00 2001 From: Subhaprada Chand Date: Fri, 3 Mar 2017 05:25:22 +0530 Subject: [PATCH] Replace instances of new Date().getTime() with System.currentTimeMillis() --- .../java/com/fsck/k9/provider/AttachmentTempFileProvider.java | 2 +- .../main/java/com/fsck/k9/provider/DecryptedFileProvider.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k9mail/src/main/java/com/fsck/k9/provider/AttachmentTempFileProvider.java b/k9mail/src/main/java/com/fsck/k9/provider/AttachmentTempFileProvider.java index ce5a06172..f81631732 100644 --- a/k9mail/src/main/java/com/fsck/k9/provider/AttachmentTempFileProvider.java +++ b/k9mail/src/main/java/com/fsck/k9/provider/AttachmentTempFileProvider.java @@ -95,7 +95,7 @@ public class AttachmentTempFileProvider extends FileProvider { public static boolean deleteOldTemporaryFiles(Context context) { File tempDirectory = getTempFileDirectory(context); boolean allFilesDeleted = true; - long deletionThreshold = new Date().getTime() - FILE_DELETE_THRESHOLD_MILLISECONDS; + long deletionThreshold = System.currentTimeMillis() - FILE_DELETE_THRESHOLD_MILLISECONDS; for (File tempFile : tempDirectory.listFiles()) { long lastModified = tempFile.lastModified(); if (lastModified < deletionThreshold) { diff --git a/k9mail/src/main/java/com/fsck/k9/provider/DecryptedFileProvider.java b/k9mail/src/main/java/com/fsck/k9/provider/DecryptedFileProvider.java index 653e42433..32f61be99 100644 --- a/k9mail/src/main/java/com/fsck/k9/provider/DecryptedFileProvider.java +++ b/k9mail/src/main/java/com/fsck/k9/provider/DecryptedFileProvider.java @@ -74,7 +74,7 @@ public class DecryptedFileProvider extends FileProvider { public static boolean deleteOldTemporaryFiles(Context context) { File tempDirectory = getDecryptedTempDirectory(context); boolean allFilesDeleted = true; - long deletionThreshold = new Date().getTime() - FILE_DELETE_THRESHOLD_MILLISECONDS; + long deletionThreshold = System.currentTimeMillis() - FILE_DELETE_THRESHOLD_MILLISECONDS; for (File tempFile : tempDirectory.listFiles()) { long lastModified = tempFile.lastModified(); if (lastModified < deletionThreshold) {