From e8a4eaf8cd6e6ab3a5b0198060ff968f171d53d9 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Wed, 3 Jul 2019 11:37:35 +0200 Subject: correct webpreview cache paths --- .../java/de/pixart/messenger/services/XmppConnectionService.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 7fabd1806..410058d58 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -792,12 +792,11 @@ public class XmppConnectionService extends Service { } private void deleteWebpreviewCache() { - long start = SystemClock.elapsedRealtime(); try { - final String path = getApplicationContext().getCacheDir() + File.separator + RICH_LINK_METADATA; + long start = SystemClock.elapsedRealtime(); final Calendar time = Calendar.getInstance(); time.add(Calendar.DAY_OF_YEAR, -7); - final File directory = new File(path); + final File directory = new File(getCacheDir().getAbsolutePath(), File.separator + RICH_LINK_METADATA); if (!directory.exists()) { return; } @@ -814,7 +813,7 @@ public class XmppConnectionService extends Service { Log.d(Config.LOGTAG, "Deleted " + count + " expired webpreview cache files in " + (SystemClock.elapsedRealtime() - start) + "ms"); } } catch (Exception e) { - Log.d(Config.LOGTAG, "Deleted no expired webpreview cache files because of " + e + " in " + (SystemClock.elapsedRealtime() - start) + "ms"); + Log.d(Config.LOGTAG, "Deleted no expired webpreview cache files because of " + e); } } -- cgit v1.2.3