Merge "Remove dependency on support library. DO NOT MERGE." into ics-mr1
diff --git a/gallerycommon/src/com/android/gallery3d/common/BlobCache.java b/gallerycommon/src/com/android/gallery3d/common/BlobCache.java
index 19a2e30..7788e61 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.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 @@
 
     // 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 a69d6e1..938ef8c 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.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 @@
         mDbHelper = new DatabaseHelper(context, dbName);
     }
 
+    public void close() {
+        mDbHelper.close();
+    }
+
     public void store(String downloadUrl, File file) {
         if (!mInitialized) initialize();