summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2012-06-28 17:12:20 +0800
committerOwen Lin <owenlin@google.com>2012-07-03 18:05:47 +0800
commitdf4763cf8752fb1babc7244fc2be33ed87d3b072 (patch)
tree46e4206a429da568320f59a3391e5f22eb4c8b7d /src/com/android/gallery3d/app
parentca7d9bfb42c1d5037bcecdde30eb836755140b03 (diff)
downloadandroid_packages_apps_Gallery2-df4763cf8752fb1babc7244fc2be33ed87d3b072.tar.gz
android_packages_apps_Gallery2-df4763cf8752fb1babc7244fc2be33ed87d3b072.tar.bz2
android_packages_apps_Gallery2-df4763cf8752fb1babc7244fc2be33ed87d3b072.zip
Don't reuse bitmap before HoneyComb.
Change-Id: I0df9bf0a8f43e28ed25b436d4c584dc3ceb43c1d
Diffstat (limited to 'src/com/android/gallery3d/app')
-rw-r--r--src/com/android/gallery3d/app/AbstractGalleryActivity.java10
-rw-r--r--src/com/android/gallery3d/app/CropImage.java3
-rw-r--r--src/com/android/gallery3d/app/MoviePlayer.java5
-rw-r--r--src/com/android/gallery3d/app/Wallpaper.java2
4 files changed, 14 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
index 0987ac39f..9b2a85ed4 100644
--- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java
+++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
@@ -32,6 +32,7 @@ import android.view.Window;
import android.view.WindowManager;
import com.android.gallery3d.R;
+import com.android.gallery3d.data.BitmapPool;
import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.ui.GLRoot;
@@ -188,11 +189,16 @@ public class AbstractGalleryActivity extends Activity implements GalleryActivity
} finally {
mGLRootView.unlockRenderThread();
}
- MediaItem.getMicroThumbPool().clear();
- MediaItem.getThumbPool().clear();
+ clearBitmapPool(MediaItem.getMicroThumbPool());
+ clearBitmapPool(MediaItem.getThumbPool());
+
MediaItem.getBytesBufferPool().clear();
}
+ private static void clearBitmapPool(BitmapPool pool) {
+ if (pool != null) pool.clear();
+ }
+
@Override
protected void onDestroy() {
super.onDestroy();
diff --git a/src/com/android/gallery3d/app/CropImage.java b/src/com/android/gallery3d/app/CropImage.java
index f2646978a..294e285ea 100644
--- a/src/com/android/gallery3d/app/CropImage.java
+++ b/src/com/android/gallery3d/app/CropImage.java
@@ -33,6 +33,7 @@ import android.graphics.Rect;
import android.graphics.RectF;
import android.media.ExifInterface;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
@@ -369,7 +370,7 @@ public class CropImage extends AbstractGalleryActivity {
}
}
- @TargetApi(ApiHelper.VERSION_CODES.JELLY_BEAN)
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private static void setImageSize(ContentValues values, int width, int height) {
// The two fields are available since ICS but got published in JB
if (ApiHelper.HAS_MEDIA_COLUMNS_WIDTH_AND_HEIGHT) {
diff --git a/src/com/android/gallery3d/app/MoviePlayer.java b/src/com/android/gallery3d/app/MoviePlayer.java
index 4f72c13ba..660c4d953 100644
--- a/src/com/android/gallery3d/app/MoviePlayer.java
+++ b/src/com/android/gallery3d/app/MoviePlayer.java
@@ -29,6 +29,7 @@ import android.graphics.Color;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
@@ -178,7 +179,7 @@ public class MoviePlayer implements
}
}
- @TargetApi(ApiHelper.VERSION_CODES.JELLY_BEAN)
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void setOnSystemUiVisibilityChangeListener() {
if (!ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_HIDE_NAVIGATION) return;
@@ -212,7 +213,7 @@ public class MoviePlayer implements
});
}
- @TargetApi(ApiHelper.VERSION_CODES.JELLY_BEAN)
+ @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
private void showSystemUi(boolean visible) {
if (!ApiHelper.HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE) return;
diff --git a/src/com/android/gallery3d/app/Wallpaper.java b/src/com/android/gallery3d/app/Wallpaper.java
index 1ece66c49..996d3f080 100644
--- a/src/com/android/gallery3d/app/Wallpaper.java
+++ b/src/com/android/gallery3d/app/Wallpaper.java
@@ -63,7 +63,7 @@ public class Wallpaper extends Activity {
}
@SuppressWarnings("deprecation")
- @TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB_MR2)
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
private Point getDefaultDisplaySize(Point size) {
Display d = getWindowManager().getDefaultDisplay();
if (Build.VERSION.SDK_INT >= ApiHelper.VERSION_CODES.HONEYCOMB_MR2) {