diff options
author | Jeff Sharkey <jsharkey@android.com> | 2011-12-01 11:48:20 -0800 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2011-12-01 11:50:15 -0800 |
commit | af5e2faf47b3a71c07a9069efed2de31e49b4883 (patch) | |
tree | 28f480dbcb1e298bc30104f920f4fafe4d65c6d0 | |
parent | 88da27576ef7709a462bc518fbc146ca06fd049c (diff) | |
parent | 7fb19a9cef3a4ae0dbfa32ea4cb03d14e01cd2cf (diff) | |
download | android_packages_apps_Snap-af5e2faf47b3a71c07a9069efed2de31e49b4883.tar.gz android_packages_apps_Snap-af5e2faf47b3a71c07a9069efed2de31e49b4883.tar.bz2 android_packages_apps_Snap-af5e2faf47b3a71c07a9069efed2de31e49b4883.zip |
resolved conflicts for merge of c0715fd5 to master
Change-Id: Iab2221b984c2b86d0b220466f58368fbf1af5e20
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/BlobCache.java | 3 | ||||
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/FileCache.java | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/BlobCache.java b/gallerycommon/src/com/android/gallery3d/common/BlobCache.java index 19a2e3090..7788e61f5 100644 --- a/gallerycommon/src/com/android/gallery3d/common/BlobCache.java +++ b/gallerycommon/src/com/android/gallery3d/common/BlobCache.java @@ -76,7 +76,7 @@ import java.nio.MappedByteBuffer; import java.nio.channels.FileChannel; import java.util.zip.Adler32; -public class BlobCache { +public class BlobCache implements Closeable { private static final String TAG = "BlobCache"; private static final int MAGIC_INDEX_FILE = 0xB3273030; @@ -171,6 +171,7 @@ public class BlobCache { // Close the cache. All resources are released. No other method should be // called after this is called. + @Override public void close() { syncAll(); closeAll(); diff --git a/gallerycommon/src/com/android/gallery3d/common/FileCache.java b/gallerycommon/src/com/android/gallery3d/common/FileCache.java index 86a195532..938ef8c1a 100644 --- a/gallerycommon/src/com/android/gallery3d/common/FileCache.java +++ b/gallerycommon/src/com/android/gallery3d/common/FileCache.java @@ -25,10 +25,11 @@ import android.util.Log; import com.android.gallery3d.common.Entry.Table; +import java.io.Closeable; import java.io.File; import java.io.IOException; -public class FileCache { +public class FileCache implements Closeable { private static final int LRU_CAPACITY = 4; private static final int MAX_DELETE_COUNT = 16; @@ -91,6 +92,10 @@ public class FileCache { mDbHelper = new DatabaseHelper(context, dbName); } + public void close() { + mDbHelper.close(); + } + public void store(String downloadUrl, File file) { if (!mInitialized) initialize(); |