diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-07-13 14:57:26 +0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-07-13 01:01:50 -0700 |
commit | 00862f13a4b7be86ee7fec8eead0bb4e35193cd7 (patch) | |
tree | c8f7e04f6ec618c7e939200c9943963ce6b40397 | |
parent | 708bfce7f38274073611a32de69e16fe8bf292ea (diff) | |
download | android_packages_apps_Snap-00862f13a4b7be86ee7fec8eead0bb4e35193cd7.tar.gz android_packages_apps_Snap-00862f13a4b7be86ee7fec8eead0bb4e35193cd7.tar.bz2 android_packages_apps_Snap-00862f13a4b7be86ee7fec8eead0bb4e35193cd7.zip |
Only use SurfaceTexture.release and setIconAttribute on newer platforms.
Bug: 6706784
Change-Id: Ic1bb2bb27c3184d791de566d88dbade039fb9d87
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 6 |
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); |