summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/gallery/SingleImageList.java
diff options
context:
space:
mode:
authorRay Chen <>2009-04-10 02:11:35 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-10 02:11:35 -0700
commit993105a927b1b67ce04cd56a597d3d6742e7c205 (patch)
tree5b99c560886ad1872332b872f0ae22ee7125d8ef /src/com/android/camera/gallery/SingleImageList.java
parent9dacf7b214339440c16f3d66e12d6afef1248f68 (diff)
downloadLegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.zip
LegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.tar.gz
LegacyCamera-993105a927b1b67ce04cd56a597d3d6742e7c205.tar.bz2
AI 145696: Utilize BitmapManager to control bitmap related resources, making
decoding cancelable, thus reduce activities switch latency and gallery related ANR. BUG=1692286 Automated import of CL 145696
Diffstat (limited to 'src/com/android/camera/gallery/SingleImageList.java')
-rw-r--r--src/com/android/camera/gallery/SingleImageList.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/android/camera/gallery/SingleImageList.java b/src/com/android/camera/gallery/SingleImageList.java
index 03f9f2d..ec71d55 100644
--- a/src/com/android/camera/gallery/SingleImageList.java
+++ b/src/com/android/camera/gallery/SingleImageList.java
@@ -16,6 +16,8 @@
package com.android.camera.gallery;
+import com.android.camera.BitmapManager;
+
import android.content.ContentResolver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -85,7 +87,7 @@ public class SingleImageList extends BaseImageList implements IImageList {
ParcelFileDescriptor pfdInput = getPFD();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
- BitmapFactory.decodeFileDescriptor(
+ BitmapManager.instance().decodeFileDescriptor(
pfdInput.getFileDescriptor(), null, options);
if (targetWidthHeight != -1) {
@@ -97,7 +99,7 @@ public class SingleImageList extends BaseImageList implements IImageList {
options.inDither = false;
options.inPreferredConfig = Bitmap.Config.ARGB_8888;
- Bitmap b = BitmapFactory.decodeFileDescriptor(
+ Bitmap b = BitmapManager.instance().decodeFileDescriptor(
pfdInput.getFileDescriptor(), null, options);
if (VERBOSE) {
Log.v(TAG, "B: got bitmap " + b + " with sampleSize "
@@ -223,7 +225,7 @@ public class SingleImageList extends BaseImageList implements IImageList {
Uri uri = fullSizeImageUri();
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
- BitmapFactory.decodeFileDescriptor(
+ BitmapManager.instance().decodeFileDescriptor(
input.getFileDescriptor(), null, options);
return options;
} finally {
@@ -358,13 +360,13 @@ public class SingleImageList extends BaseImageList implements IImageList {
if (targetWidthHeight != -1) {
options.inJustDecodeBounds = true;
- BitmapFactory.decodeFileDescriptor(
+ BitmapManager.instance().decodeFileDescriptor(
pfdInput.getFileDescriptor(), null, options);
options.inSampleSize =
Util.computeSampleSize(options, targetWidthHeight);
options.inJustDecodeBounds = false;
}
- b = BitmapFactory.decodeFileDescriptor(
+ b = BitmapManager.instance().decodeFileDescriptor(
pfdInput.getFileDescriptor(), null, options);
if (VERBOSE) {
Log.v(TAG, "C: got bitmap " + b + " with sampleSize "