summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2018-12-27 12:29:15 +0100
committerMichael Bestas <mkbestas@lineageos.org>2019-11-09 22:47:37 +0200
commit73050e6fab9935619103c3a37b6bee76b9f915c6 (patch)
tree1bd63c0f6b7b55c76840baa228da127c9f1096e3
parentf86cde6d424cbe8b3a3b2b404e82f484f8b9a8d4 (diff)
downloadandroid_packages_apps_Snap-73050e6fab9935619103c3a37b6bee76b9f915c6.zip
android_packages_apps_Snap-73050e6fab9935619103c3a37b6bee76b9f915c6.tar.gz
android_packages_apps_Snap-73050e6fab9935619103c3a37b6bee76b9f915c6.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 012a22d..8848842 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>
@@ -488,6 +490,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) {
@@ -1325,9 +1330,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) {
@@ -1672,6 +1679,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)) {
@@ -1683,6 +1695,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)) {