From 109bbb6199f48aa677f425dc0d5fb2ae3e8765fc Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Fri, 13 Jul 2012 14:57:26 +0800 Subject: Only use SurfaceTexture.release and setIconAttribute on newer platforms. Bug: 6706784 Change-Id: Ic1bb2bb27c3184d791de566d88dbade039fb9d87 --- gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gallerycommon/src') 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); -- cgit v1.2.3