summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-07-30 21:37:36 -0700
committerArne Coucheron <arco68@gmail.com>2018-01-26 01:08:27 +0100
commit2e90aa3f7e876beb9873a4c3feafd70b52957564 (patch)
tree03f323239adaf16e6fdc873b1aa849a3bed0897f
parentdf787867c1390eb3edcfec9103659d980d97a61d (diff)
downloadandroid_packages_apps_Snap-2e90aa3f7e876beb9873a4c3feafd70b52957564.zip
android_packages_apps_Snap-2e90aa3f7e876beb9873a4c3feafd70b52957564.tar.gz
android_packages_apps_Snap-2e90aa3f7e876beb9873a4c3feafd70b52957564.tar.bz2
snap: Additional fixes for auto-HDR mode
Change-Id: I0d9b982dc9d817b40d59fc5fa58d542a213a3d1f
-rw-r--r--src/com/android/camera/PhotoModule.java67
1 files changed, 41 insertions, 26 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index b59d516..57fcc40 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -110,6 +110,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.Arrays;
import java.lang.NumberFormatException;
import java.util.List;
import java.util.Vector;
@@ -3789,32 +3790,6 @@ public class PhotoModule
String zsl = mPreferences.getString(CameraSettings.KEY_ZSL,
mActivity.getString(R.string.pref_camera_zsl_default));
- String auto_hdr = mPreferences.getString(CameraSettings.KEY_AUTO_HDR,
- mActivity.getString(R.string.pref_camera_auto_hdr_default));
- if (CameraUtil.isAutoHDRSupported(mParameters)) {
- mParameters.set("auto-hdr-enable",auto_hdr);
- if (auto_hdr.equals("enable")) {
- mActivity.runOnUiThread(new Runnable() {
- public void run() {
- if (mDrawAutoHDR != null) {
- mDrawAutoHDR.setVisibility(View.VISIBLE);
- }
- }
- });
- mParameters.setSceneMode("asd");
- mCameraDevice.setMetadataCb(mMetaDataCallback);
- }
- else {
- mAutoHdrEnable = false;
- mActivity.runOnUiThread( new Runnable() {
- public void run () {
- if (mDrawAutoHDR != null) {
- mDrawAutoHDR.setVisibility (View.INVISIBLE);
- }
- }
- });
- }
- }
ParametersWrapper.setZSLMode(mParameters, zsl);
if(zsl.equals("on") && ParametersWrapper.getSupportedZSLModes(mParameters) != null) {
//Switch on ZSL Camera mode
@@ -3895,6 +3870,8 @@ public class PhotoModule
+ mInstantCaptureSnapShot);
mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE, instantCapture);
+ updateAutoHDR();
+
//Set Histogram
String histogram = mPreferences.getString(
CameraSettings.KEY_HISTOGRAM,
@@ -4002,6 +3979,44 @@ public class PhotoModule
}
}
+ private void updateAutoHDR() {
+ String autoHdr = mPreferences.getString(CameraSettings.KEY_AUTO_HDR,
+ mActivity.getString(R.string.pref_camera_auto_hdr_default));
+ String advancedFeature = mPreferences.getString(
+ CameraSettings.KEY_ADVANCED_FEATURES,
+ mActivity.getString(R.string.pref_camera_advanced_feature_default));
+
+ if (CameraUtil.isAutoHDRSupported(mParameters)) {
+ if (autoHdr.equals("enable") &&
+ ("asd".equals(mSceneMode) || "auto".equals(mSceneMode)) &&
+ CameraUtil.isSupported("asd", mParameters.getSupportedSceneModes()) &&
+ (advancedFeature == null || "none".equals(advancedFeature))) {
+ mActivity.runOnUiThread(new Runnable() {
+ public void run() {
+ if (mDrawAutoHDR != null) {
+ mDrawAutoHDR.setVisibility(View.VISIBLE);
+ }
+ }
+ });
+ mParameters.setSceneMode("asd");
+ mCameraDevice.setMetadataCb(mMetaDataCallback);
+ mParameters.set("auto-hdr-enable", "enable");
+ }
+ else {
+ mAutoHdrEnable = false;
+ mActivity.runOnUiThread( new Runnable() {
+ public void run () {
+ if (mDrawAutoHDR != null) {
+ mDrawAutoHDR.setVisibility (View.INVISIBLE);
+ }
+ }
+ });
+ mCameraDevice.setMetadataCb(null);
+ mParameters.set("auto-hdr-enable", "disable");
+ }
+ }
+ }
+
private void setFlipValue() {
// Read Flip mode from adb command
//value: 0(default) - FLIP_MODE_OFF