summaryrefslogtreecommitdiffstats
path: root/gallerycommon
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
commit714f5b3197152fea7b237882462367791e403599 (patch)
tree0c2f8b49fbf2dbd44abaf61f78d1b5d4ca676970 /gallerycommon
parentd6e8dd7466a6faca9694220384c5217077bd1d58 (diff)
parent36d16bc95d7ed7d12fc8136ae68a9579b20cf5a1 (diff)
downloadandroid_packages_apps_Snap-714f5b3197152fea7b237882462367791e403599.tar.gz
android_packages_apps_Snap-714f5b3197152fea7b237882462367791e403599.tar.bz2
android_packages_apps_Snap-714f5b3197152fea7b237882462367791e403599.zip
Merge "Add an API check for starting preview in Jpeg callback." into gb-ub-photos-arches
Diffstat (limited to 'gallerycommon')
-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);