summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d/common/FileCache.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2011-12-01 14:43:54 +0800
committerOwen Lin <owenlin@google.com>2011-12-01 16:27:22 +0800
commit7fb19a9cef3a4ae0dbfa32ea4cb03d14e01cd2cf (patch)
tree28f480dbcb1e298bc30104f920f4fafe4d65c6d0 /gallerycommon/src/com/android/gallery3d/common/FileCache.java
parentb74708a8103bf95781727a49c05a4c8514ad274b (diff)
downloadandroid_packages_apps_Snap-7fb19a9cef3a4ae0dbfa32ea4cb03d14e01cd2cf.tar.gz
android_packages_apps_Snap-7fb19a9cef3a4ae0dbfa32ea4cb03d14e01cd2cf.tar.bz2
android_packages_apps_Snap-7fb19a9cef3a4ae0dbfa32ea4cb03d14e01cd2cf.zip
Add close() to Download cache.
Change-Id: Idf0482e9f3cd2f667dca902ffea75bb0a0225d2d fix: 5664497
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/common/FileCache.java')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/FileCache.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/FileCache.java b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
index a69d6e170..938ef8c1a 100644
--- a/gallerycommon/src/com/android/gallery3d/common/FileCache.java
+++ b/gallerycommon/src/com/android/gallery3d/common/FileCache.java
@@ -16,8 +16,6 @@
package com.android.gallery3d.common;
-import com.android.gallery3d.common.Entry.Table;
-
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
@@ -25,10 +23,13 @@ import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
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();