summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-07-13 14:57:26 +0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-07-13 01:01:50 -0700
commit840ae396bac4ff8ff34e88c8d2a1773cb112a4b6 (patch)
treee1fee077cf4377eba296f9874d945554ffa64435 /gallerycommon/src/com
parent1b10bf568327fa6c6c1ddbfd98cb17524bebfd46 (diff)
downloadandroid_packages_apps_Gallery2-840ae396bac4ff8ff34e88c8d2a1773cb112a4b6.tar.gz
android_packages_apps_Gallery2-840ae396bac4ff8ff34e88c8d2a1773cb112a4b6.tar.bz2
android_packages_apps_Gallery2-840ae396bac4ff8ff34e88c8d2a1773cb112a4b6.zip
Only use SurfaceTexture.release and setIconAttribute on newer platforms.
Bug: 6706784 Change-Id: Ic1bb2bb27c3184d791de566d88dbade039fb9d87
Diffstat (limited to 'gallerycommon/src/com')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index 753cacdf7..620e1ae7a 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -61,6 +61,9 @@ public class ApiHelper {
"android.graphics.SurfaceTexture", "setDefaultBufferSize",
int.class, int.class);
+ public static final boolean HAS_RELEASE_SURFACE_TEXTURE = hasMethod(
+ "android.graphics.SurfaceTexture", "release");
+
public static final boolean HAS_MTP =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1;
@@ -102,6 +105,9 @@ public class ApiHelper {
}
}
+ public static final boolean HAS_SET_ICON_ATTRIBUTE =
+ Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+
private static boolean hasField(Class<?> klass, String fieldName) {
try {
klass.getDeclaredField(fieldName);