diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-02-09 15:14:14 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-02-09 15:14:14 +0100 |
commit | 793810d4c06a40a33e1fb51fa8c1b8fa94e37f8a (patch) | |
tree | f7e69c2e2f6a87eb0ef972cc4c2275da3c58ecd3 /src | |
parent | 9044f7cc66f92cebcc2c2545788a4a142291bb79 (diff) |
do not sync thumbnail creation on cache
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/FileBackend.java | 5 |
1 files changed, 4 insertions, 1 deletions
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<String, Bitmap> 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; |