summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2016-02-22 06:50:53 +0100
committerArne Coucheron <arco68@gmail.com>2016-02-26 11:14:34 +0100
commit1b0670f436fe17ee404bc8eff3e9162b5a699c8c (patch)
treeda044ee33da03e459fecb2f6846cfdf36a169bee
parent1d957349aa4a487572af492cde85d2f7cea5204f (diff)
downloadandroid_packages_apps_Snap-1b0670f436fe17ee404bc8eff3e9162b5a699c8c.zip
android_packages_apps_Snap-1b0670f436fe17ee404bc8eff3e9162b5a699c8c.tar.gz
android_packages_apps_Snap-1b0670f436fe17ee404bc8eff3e9162b5a699c8c.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. Change-Id: I2ec82ae38505b6674f1a34e98d1b1fb2dbc2a714
-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());