summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CaptureModule.java2
-rw-r--r--src/com/android/camera/CaptureUI.java1
-rw-r--r--src/com/android/camera/SettingsManager.java20
3 files changed, 22 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 2b28f99..feef31f 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -2038,7 +2038,7 @@ public class CaptureModule implements CameraModule, PhotoController,
.FLASH_MODE_OFF);
break;
case CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH:
- if (redeye.equals("disable")) {
+ if (redeye != null && redeye.equals("disable")) {
request.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest
.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE);
}
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 5b8ecad..3d766fa 100644
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -96,6 +96,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
SettingsManager.KEY_MAKEUP
};
String[] mDeveloperKeys = new String[]{
+ SettingsManager.KEY_REDEYE_REDUCTION,
SettingsManager.KEY_MONO_ONLY,
SettingsManager.KEY_CLEARSIGHT,
SettingsManager.KEY_MONO_PREVIEW
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index f3a2285..3a5f6f7 100644
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -36,6 +36,7 @@ import android.graphics.Rect;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
+import android.hardware.camera2.CameraMetadata;
import android.hardware.camera2.params.StreamConfigurationMap;
import android.util.Log;
import android.util.Range;
@@ -491,6 +492,7 @@ public class SettingsManager implements ListMenu.SettingsListener {
ListPreference clearsight = mPreferenceGroup.findPreference(KEY_CLEARSIGHT);
ListPreference monoPreview = mPreferenceGroup.findPreference(KEY_MONO_PREVIEW);
ListPreference monoOnly = mPreferenceGroup.findPreference(KEY_MONO_ONLY);
+ ListPreference redeyeReduction = mPreferenceGroup.findPreference(KEY_REDEYE_REDUCTION);
if (whiteBalance != null) {
CameraSettings.filterUnsupportedOptions(mPreferenceGroup,
@@ -529,7 +531,11 @@ public class SettingsManager implements ListMenu.SettingsListener {
if (clearsight != null) removePreference(mPreferenceGroup, KEY_CLEARSIGHT);
if (monoPreview != null) removePreference(mPreferenceGroup, KEY_MONO_PREVIEW);
if (monoOnly != null) removePreference(mPreferenceGroup, KEY_MONO_ONLY);
+ }
+ if (redeyeReduction != null) {
+ CameraSettings.filterUnsupportedOptions(mPreferenceGroup,
+ redeyeReduction, getSupportedRedeyeReduction(cameraId));
}
}
@@ -682,6 +688,20 @@ public class SettingsManager implements ListMenu.SettingsListener {
return res;
}
+ private List<String> getSupportedRedeyeReduction(int cameraId) {
+ int[] flashModes = mCharacteristics.get(cameraId).get(CameraCharacteristics
+ .CONTROL_AE_AVAILABLE_MODES);
+ List<String> modes = new ArrayList<>();
+ for (int i = 0; i < flashModes.length; i++) {
+ if (flashModes[i] == CameraMetadata.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE) {
+ modes.add("disable");
+ modes.add("enable");
+ break;
+ }
+ }
+ return modes;
+ }
+
private List<String> getSupportedWhiteBalanceModes(int cameraId) {
int[] whiteBalanceModes = mCharacteristics.get(cameraId).get(CameraCharacteristics
.CONTROL_AWB_AVAILABLE_MODES);