From 793810d4c06a40a33e1fb51fa8c1b8fa94e37f8a Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 9 Feb 2017 15:14:14 +0100 Subject: do not sync thumbnail creation on cache --- src/main/java/de/pixart/messenger/persistance/FileBackend.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/persistance/FileBackend.java b/src/main/java/de/pixart/messenger/persistance/FileBackend.java index da7ed84dc..d670c98d9 100644 --- a/src/main/java/de/pixart/messenger/persistance/FileBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/FileBackend.java @@ -60,6 +60,9 @@ import de.pixart.messenger.utils.MimeUtils; import de.pixart.messenger.xmpp.pep.Avatar; public class FileBackend { + + private static final Object THUMBNAIL_LOCK = new Object(); + private static final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmssSSS", Locale.US); private static final String FILE_PROVIDER = ".files"; @@ -430,7 +433,7 @@ public class FileBackend { final LruCache cache = mXmppConnectionService.getBitmapCache(); Bitmap thumbnail = cache.get(uuid); if ((thumbnail == null) && (!cacheOnly)) { - synchronized (cache) { + synchronized (THUMBNAIL_LOCK) { thumbnail = cache.get(uuid); if (thumbnail != null) { return thumbnail; -- cgit v1.2.3