Stop double caching the thumbnails
Notification doesn't need it cached anyway, so save the space.
This commit is contained in:
parent
840c96c5e1
commit
7a809bd26a
|
@ -946,18 +946,10 @@ public class FileBackend {
|
|||
return thumbnail;
|
||||
}
|
||||
|
||||
public Bitmap getThumbnailBitmap(Message message, Resources res, int size, boolean cacheOnly) throws IOException {
|
||||
final String uuid = message.getUuid();
|
||||
final LruCache<String, Bitmap> cache = mXmppConnectionService.getBitmapCache();
|
||||
Bitmap thumbnail = cache.get(uuid);
|
||||
if ((thumbnail == null) && (!cacheOnly)) {
|
||||
final Drawable drawable = getThumbnail(message, res, size, cacheOnly);
|
||||
if (drawable != null) {
|
||||
thumbnail = drawDrawable(drawable);
|
||||
cache.put(uuid, thumbnail);
|
||||
}
|
||||
}
|
||||
return thumbnail;
|
||||
public Bitmap getThumbnailBitmap(Message message, Resources res, int size) throws IOException {
|
||||
final Drawable drawable = getThumbnail(message, res, size, false);
|
||||
if (drawable == null) return null;
|
||||
return drawDrawable(drawable);
|
||||
}
|
||||
|
||||
private Drawable getImagePreview(File file, Resources res, int size, final String mime) throws IOException {
|
||||
|
|
|
@ -1062,7 +1062,7 @@ public class NotificationService {
|
|||
|
||||
private void modifyForImage(final Builder builder, final Message message, final ArrayList<Message> messages) {
|
||||
try {
|
||||
final Bitmap bitmap = mXmppConnectionService.getFileBackend().getThumbnailBitmap(message, mXmppConnectionService.getResources(), getPixel(288), false);
|
||||
final Bitmap bitmap = mXmppConnectionService.getFileBackend().getThumbnailBitmap(message, mXmppConnectionService.getResources(), getPixel(288));
|
||||
final ArrayList<Message> tmp = new ArrayList<>();
|
||||
for (final Message msg : messages) {
|
||||
if (msg.getType() == Message.TYPE_TEXT
|
||||
|
|
Loading…
Reference in a new issue