summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-07-03 19:33:46 +0800
committerChih-Chung Chang <chihchung@google.com>2012-07-04 12:53:14 +0800
commit59b53e0547413da04cb4c7409f8331dc5d8481f2 (patch)
tree27e4fd0ced4a96c4ea8f297e3b5f08a9046461bc /gallerycommon/src
parentaadaaa8482521a1b468f6b3a65811aac8ac212f0 (diff)
downloadandroid_packages_apps_Snap-59b53e0547413da04cb4c7409f8331dc5d8481f2.tar.gz
android_packages_apps_Snap-59b53e0547413da04cb4c7409f8331dc5d8481f2.tar.bz2
android_packages_apps_Snap-59b53e0547413da04cb4c7409f8331dc5d8481f2.zip
Use MTP only if the MTP API is available.
Change-Id: I5c747d0da2905eb344c56dfab6333034dd5eecc3
Diffstat (limited to 'gallerycommon/src')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java3
1 files changed, 3 insertions, 0 deletions
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);