summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d
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
commit109bbb6199f48aa677f425dc0d5fb2ae3e8765fc (patch)
tree16bf3e75b4dedec60591bce6a9123665b819f210 /gallerycommon/src/com/android/gallery3d
parent6911cdad988bc9abdf32a34a5b3c60374dd4a9e4 (diff)
downloadandroid_packages_apps_Snap-109bbb6199f48aa677f425dc0d5fb2ae3e8765fc.tar.gz
android_packages_apps_Snap-109bbb6199f48aa677f425dc0d5fb2ae3e8765fc.tar.bz2
android_packages_apps_Snap-109bbb6199f48aa677f425dc0d5fb2ae3e8765fc.zip
Only use SurfaceTexture.release and setIconAttribute on newer platforms.
Bug: 6706784 Change-Id: Ic1bb2bb27c3184d791de566d88dbade039fb9d87
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d')
-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);