summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2016-02-22 06:50:53 +0100
committerAbhisek Devkota <ciwrl@cyanogenmod.com>2016-03-07 15:08:23 -0800
commit1e99d0c85a354d6b873e19ebe8947a1cc6fd94bd (patch)
tree3508e5cf59f3503c80dd132968362e307803d5e7
parentf663ae678df2effa6937713c11bdad847b0d8910 (diff)
downloadandroid_packages_apps_Snap-1e99d0c85a354d6b873e19ebe8947a1cc6fd94bd.zip
android_packages_apps_Snap-1e99d0c85a354d6b873e19ebe8947a1cc6fd94bd.tar.gz
android_packages_apps_Snap-1e99d0c85a354d6b873e19ebe8947a1cc6fd94bd.tar.bz2
Snap: Remove face detection option if not supported
Removes the face detection option from preference list if the "face-detection" camera parameter is blank/doesn't exist. RM-208 Change-Id: I2ec82ae38505b6674f1a34e98d1b1fb2dbc2a714 (cherry picked from commit 1b0670f436fe17ee404bc8eff3e9162b5a699c8c)
-rw-r--r--src/com/android/camera/CameraSettings.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index d05c3a5..fd15414 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -140,6 +140,7 @@ public class CameraSettings {
private static final String KEY_QC_SUPPORTED_TNR_MODES = "tnr-mode-values";
private static final String KEY_QC_SUPPORTED_VIDEO_TNR_MODES = "video-tnr-mode-values";
private static final String KEY_QC_SUPPORTED_PREVIEW_FORMATS = "preview-format-values";
+ private static final String KEY_QC_SUPPORTED_FACE_DETECTION = "face-detection-values";
private static final String KEY_SNAPCAM_SUPPORTED_HDR_MODES = "hdr-mode-values";
private static final String KEY_SNAPCAM_SUPPORTED_HDR_NEED_1X = "hdr-need-1x-values";
public static final String KEY_SNAPCAM_SHUTTER_SPEED = "shutter-speed";
@@ -455,6 +456,14 @@ public class CameraSettings {
return split(str);
}
+ public static List<String> getSupportedFaceDetection(Parameters params) {
+ String str = params.get(KEY_QC_SUPPORTED_FACE_DETECTION);
+ if (str == null) {
+ return null;
+ }
+ return split(str);
+ }
+
public static List<String> getSupportedDISModes(Parameters params) {
String str = params.get(KEY_QC_SUPPORTED_DIS_MODES);
if (str == null) {
@@ -793,6 +802,11 @@ public class CameraSettings {
faceRC, getSupportedFaceRecognitionModes(mParameters));
}
+ if (faceDetection != null) {
+ filterUnsupportedOptions(group,
+ faceDetection, getSupportedFaceDetection(mParameters));
+ }
+
if (autoExposure != null) {
filterUnsupportedOptions(group,
autoExposure, mParameters.getSupportedAutoexposure());