Gallery2: Refactorize Pools class
Move Pools to other package to avoid the conflict name with the
frameworks base one, which has a different implementation.
Change-Id: Idbe79773232a957a1ef230326a142e126eebb8b4
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
diff --git a/src/com/android/photos/data/BitmapDecoder.java b/src/com/android/photos/data/BitmapDecoder.java
index a0ab410..d4db466 100644
--- a/src/com/android/photos/data/BitmapDecoder.java
+++ b/src/com/android/photos/data/BitmapDecoder.java
@@ -19,10 +19,10 @@
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.util.Log;
-import android.util.Pools.Pool;
-import android.util.Pools.SynchronizedPool;
import com.android.gallery3d.common.Utils;
+import com.android.photos.data.BitmapPools.Pool;
+import com.android.photos.data.BitmapPools.SynchronizedPool;
import java.io.BufferedInputStream;
import java.io.File;
diff --git a/src/android/util/Pools.java b/src/com/android/photos/data/BitmapPools.java
similarity index 97%
rename from src/android/util/Pools.java
rename to src/com/android/photos/data/BitmapPools.java
index 40bab1e..9708e7d 100644
--- a/src/android/util/Pools.java
+++ b/src/com/android/photos/data/BitmapPools.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.util;
+package com.android.photos.data;
/**
* Helper class for crating pools of objects. An example use looks like this:
@@ -40,7 +40,7 @@
*
* @hide
*/
-public final class Pools {
+public final class BitmapPools {
/**
* Interface for managing a pool of objects.
@@ -65,7 +65,7 @@
public boolean release(T instance);
}
- private Pools() {
+ private BitmapPools() {
/* do nothing - hiding constructor */
}
diff --git a/src/com/android/photos/data/GalleryBitmapPool.java b/src/com/android/photos/data/GalleryBitmapPool.java
index aca3e4b..9db5271 100644
--- a/src/com/android/photos/data/GalleryBitmapPool.java
+++ b/src/com/android/photos/data/GalleryBitmapPool.java
@@ -18,9 +18,9 @@
import android.graphics.Bitmap;
import android.graphics.Point;
-import android.util.Pools.Pool;
-import android.util.Pools.SynchronizedPool;
+import com.android.photos.data.BitmapPools.Pool;
+import com.android.photos.data.BitmapPools.SynchronizedPool;
import com.android.photos.data.SparseArrayBitmapPool.Node;
public class GalleryBitmapPool {
diff --git a/src/com/android/photos/data/MediaCacheUtils.java b/src/com/android/photos/data/MediaCacheUtils.java
index e3ccd14..6b7dfc2 100644
--- a/src/com/android/photos/data/MediaCacheUtils.java
+++ b/src/com/android/photos/data/MediaCacheUtils.java
@@ -21,8 +21,6 @@
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.util.Log;
-import android.util.Pools.SimplePool;
-import android.util.Pools.SynchronizedPool;
import com.android.gallery3d.R;
import com.android.gallery3d.common.BitmapUtils;
@@ -31,6 +29,8 @@
import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.util.ThreadPool.CancelListener;
import com.android.gallery3d.util.ThreadPool.JobContext;
+import com.android.photos.data.BitmapPools.SimplePool;
+import com.android.photos.data.BitmapPools.SynchronizedPool;
import com.android.photos.data.MediaRetriever.MediaSize;
import java.io.File;
diff --git a/src/com/android/photos/data/SparseArrayBitmapPool.java b/src/com/android/photos/data/SparseArrayBitmapPool.java
index 1ef9e9f..1e09cc5 100644
--- a/src/com/android/photos/data/SparseArrayBitmapPool.java
+++ b/src/com/android/photos/data/SparseArrayBitmapPool.java
@@ -19,7 +19,7 @@
import android.graphics.Bitmap;
import android.util.SparseArray;
-import android.util.Pools.Pool;
+import com.android.photos.data.BitmapPools.Pool;
public class SparseArrayBitmapPool {