summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-08-21 01:04:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-21 01:04:21 -0700
commit2f87ec50d8f934b2637363f9ef63accadf2427c2 (patch)
tree47ea6665f05a7d4471dd123ef9802b69904e1c03 /gallerycommon/src/com/android
parenta84ecfd1f81f7b2989852631d182d6898a2af32d (diff)
parent6dc1785d3f079a3b658d998aa2d3c788989e49b5 (diff)
downloadandroid_packages_apps_Snap-2f87ec50d8f934b2637363f9ef63accadf2427c2.tar.gz
android_packages_apps_Snap-2f87ec50d8f934b2637363f9ef63accadf2427c2.tar.bz2
android_packages_apps_Snap-2f87ec50d8f934b2637363f9ef63accadf2427c2.zip
Merge "Add an API check for starting preview in Jpeg callback." into gb-ub-photos-arches
Diffstat (limited to 'gallerycommon/src/com/android')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index 406c5263c..05f5b9141 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -139,16 +139,6 @@ public class ApiHelper {
public static final boolean HAS_GET_SUPPORTED_VIDEO_SIZE =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
- public static int getIntFieldIfExists(Class<?> klass, String fieldName,
- Class<?> obj, int defaultVal) {
- try {
- Field f = klass.getDeclaredField(fieldName);
- return f.getInt(obj);
- } catch (Exception e) {
- return defaultVal;
- }
- }
-
public static final boolean HAS_SET_ICON_ATTRIBUTE =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
@@ -170,6 +160,19 @@ public class ApiHelper {
public static final boolean HAS_ACTION_BAR =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
+ public static final boolean CAN_START_PREVIEW_IN_JPEG_CALLBACK =
+ Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
+
+ public static int getIntFieldIfExists(Class<?> klass, String fieldName,
+ Class<?> obj, int defaultVal) {
+ try {
+ Field f = klass.getDeclaredField(fieldName);
+ return f.getInt(obj);
+ } catch (Exception e) {
+ return defaultVal;
+ }
+ }
+
private static boolean hasField(Class<?> klass, String fieldName) {
try {
klass.getDeclaredField(fieldName);