Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58cc1bd4 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Steve Kondik
Browse files

MiniThumbFile: Fix image/bitmap retrieval



Change I66005dd69b0a5c8f4353bd7a8225d163a654fd2d changed the insertion
and creation indexing mechanism, but the retrieval method was still
using the old sparse one. Fixit

Fixes android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithBitmap,
android.provider.cts.MediaStore_Images_MediaTest#testInsertImageWithImagePath,
android.provider.cts.MediaStore_Images_ThumbnailsTest#testQueryExternalMiniThumbnails,
and android.provider.cts.MediaStore_Video_ThumbnailsTest#testGetThumbnail

Change-Id: I41feea79fa304635f3908055fb95a8c85718a97f
Signed-off-by: default avatarChet Kener <Cl3Kener@gmail.com>
parent 0fed1d8e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -393,7 +393,11 @@ public class MiniThumbFile {
        RandomAccessFile r = miniThumbDataFile();
        if (r == null) return null;

        long pos = id * BYTES_PER_MINTHUMB;
        long pos = getIndex(id, false);
        if(pos < 0) return null;

        pos *= BYTES_PER_MINTHUMB;

        FileLock lock = null;
        try {
            mBuffer.clear();