From 76bfd87c90c98a46c06ea67dd895fc8f016f7267 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Wed, 27 Jun 2012 19:01:21 +0800 Subject: Don't reuse bitmaps in BitmapRegionDecoder before JB. Change-Id: I8a2f520f98116af6861fa2cd1460e6f848bbb4e4 --- gallerycommon/Android.mk | 2 +- gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gallerycommon/Android.mk b/gallerycommon/Android.mk index a942de289..fb81dd950 100644 --- a/gallerycommon/Android.mk +++ b/gallerycommon/Android.mk @@ -22,6 +22,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := com.android.gallery3d.common2 LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_SDK_VERSION := 8 +LOCAL_SDK_VERSION := current include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java index 15026bbf3..c42c5fed6 100644 --- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java +++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java @@ -16,9 +16,12 @@ package com.android.gallery3d.common; +import android.annotation.TargetApi; +import android.os.Build; import android.provider.MediaStore.MediaColumns; import android.view.View; +@TargetApi(Build.VERSION_CODES.JELLY_BEAN) public class ApiHelper { public static final boolean HAS_VIEW_SYSTEM_UI_FLAG_LAYOUT_STABLE = @@ -30,6 +33,9 @@ public class ApiHelper { public static final boolean HAS_MEDIA_COLUMNS_WIDTH_AND_HEIGHT = hasField(MediaColumns.class, "WIDTH"); + public static final boolean HAS_REUSING_BITMAP_IN_BITMAP_REGION_DECODER = + Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; + private static boolean hasField(Class klass, String fieldName) { try { klass.getDeclaredField(fieldName); -- cgit v1.2.3