From 04ebde7418493debda790f3eae933b5f6c38e897 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Tue, 3 Jul 2012 19:33:46 +0800 Subject: Use MTP only if the MTP API is available. Change-Id: I5c747d0da2905eb344c56dfab6333034dd5eecc3 --- gallerycommon/src/com/android/gallery3d/common/ApiHelper.java | 3 +++ 1 file changed, 3 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 a908e1591..c1724a825 100644 --- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java +++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java @@ -54,6 +54,9 @@ public class ApiHelper { "android.graphics.SurfaceTexture", "setDefaultBufferSize", int.class, int.class); + public static final boolean HAS_MTP = + Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB_MR1; + private static boolean hasField(Class klass, String fieldName) { try { klass.getDeclaredField(fieldName); -- cgit v1.2.3