summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-07-30 21:37:36 -0700
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 22:00:38 +0200
commit26679b4450b89b9f26f0a7519855731c966691a2 (patch)
tree8ee81264fc800cd4694229a0159296b44e33ebf6
parent2b57b443f4f281d066a6f3b6a150ceb3d670c45a (diff)
downloadandroid_packages_apps_Snap-26679b4450b89b9f26f0a7519855731c966691a2.zip
android_packages_apps_Snap-26679b4450b89b9f26f0a7519855731c966691a2.tar.gz
android_packages_apps_Snap-26679b4450b89b9f26f0a7519855731c966691a2.tar.bz2
snap: Additional fixes for auto-HDR mode
Change-Id: I0d9b982dc9d817b40d59fc5fa58d542a213a3d1f
-rwxr-xr-xsrc/com/android/camera/PhotoModule.java66
1 files changed, 40 insertions, 26 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 10f6580..efaa87b 100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -99,6 +99,7 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
+import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import java.util.HashMap;
@@ -3623,32 +3624,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);
- }
- }
- });
- }
- }
mParameters.setZSLMode(zsl);
if(zsl.equals("on")) {
//Switch on ZSL Camera mode
@@ -3729,6 +3704,7 @@ public class PhotoModule
+ mInstantCaptureSnapShot);
mParameters.set(CameraSettings.KEY_QC_INSTANT_CAPTURE, instantCapture);
+ updateAutoHDR();
//Set Histogram
String histogram = mPreferences.getString(
@@ -3794,6 +3770,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