summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2018-12-27 12:29:15 +0100
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2019-02-06 05:22:05 +0100
commitc8c7085a9dc8ecafadf51f87f562eaf2e4f88257 (patch)
tree460d99f0d6931bea665982dc6be4fa40df3f17ae
parent180423cf6a8f2a4cead65dadf67673e00ba66ffc (diff)
downloadandroid_packages_apps_Snap-c8c7085a9dc8ecafadf51f87f562eaf2e4f88257.zip
android_packages_apps_Snap-c8c7085a9dc8ecafadf51f87f562eaf2e4f88257.tar.gz
android_packages_apps_Snap-c8c7085a9dc8ecafadf51f87f562eaf2e4f88257.tar.bz2
Snap: make support for bokeh mode configurable per device
Support is disabled by default. Change-Id: I5ab480e4eed9d314ae6f5ef78c5246397ebbe587
-rw-r--r--res/values/config.xml3
-rwxr-xr-xsrc/com/android/camera/CameraSettings.java23
2 files changed, 23 insertions, 3 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 9b506b0..3421053 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -73,4 +73,7 @@
<!-- Minimum picture size (in pixel) to include in selection list -->
<integer name="minimum_picture_size">900000</integer>
+
+ <!-- Enable support for bokeh mode -->
+ <bool name="support_bokeh_mode">false</bool>
</resources>
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index d06fb5c..ab4b1a6 100755
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -301,6 +301,8 @@ public class CameraSettings {
public static String mKeyIso = null;
public static String mKeyIsoValues = null;
+ private static boolean mSupportBokehMode = false;
+
private static final HashMap<Integer, String>
VIDEO_ENCODER_TABLE = new HashMap<Integer, String>();
public static final HashMap<String, Integer>
@@ -470,6 +472,9 @@ public class CameraSettings {
} else {
Log.d(TAG, "Using key for iso-values: " + mKeyIsoValues);
}
+
+ // Bokeh mode
+ mSupportBokehMode = mContext.getResources().getBoolean(R.bool.support_bokeh_mode);
}
public PreferenceGroup getPreferenceGroup(int preferenceRes) {
@@ -1307,9 +1312,11 @@ public class CameraSettings {
return;
}
-// if (numOfCameras > 2 ) {
-// numOfCameras = 2;
-// }
+ if (!mSupportBokehMode) {
+ if (numOfCameras > 2) {
+ numOfCameras = 2;
+ }
+ }
CharSequence[] entryValues = new CharSequence[numOfCameras];
for (int i = 0; i < numOfCameras; ++i) {
@@ -1654,6 +1661,11 @@ public class CameraSettings {
public static boolean isBokehModeSupported(Parameters params) {
boolean ret = false;
+
+ if (!mSupportBokehMode) {
+ return ret;
+ }
+
if (null != params) {
String val = params.get(KEY_QC_IS_BOKEH_MODE_SUPPORTED);
if ("1".equals(val)) {
@@ -1665,6 +1677,11 @@ public class CameraSettings {
public static boolean isBokehMPOSupported(Parameters params) {
boolean ret = false;
+
+ if (!mSupportBokehMode) {
+ return ret;
+ }
+
if (null != params) {
String val = params.get(KEY_QC_IS_BOKEH_MPO_SUPPORTED);
if ("1".equals(val)) {