fix bug where files were never deleted from cache

It was passing the wrong time value in the recursion, which made for a
really old "olderThan" time.  This also then flipped the logic on the
next round through the recursion, causing files to be deleted even if
"Keep Cache Time" was set to "Forever".

closes #719
closes #736
This commit is contained in:
Hans-Christoph Steiner 2016-08-15 23:05:12 +02:00
parent cbf5914460
commit 09829515e8

View File

@ -139,7 +139,7 @@ public class CleanCacheService extends IntentService {
long olderThan = System.currentTimeMillis() - millisAgo; long olderThan = System.currentTimeMillis() - millisAgo;
for (File f : files) { for (File f : files) {
if (f.isDirectory()) { if (f.isDirectory()) {
clearOldFiles(f, olderThan); clearOldFiles(f, millisAgo);
f.delete(); f.delete();
} }
if (Build.VERSION.SDK_INT < 21) { if (Build.VERSION.SDK_INT < 21) {