summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2018-01-04 23:13:53 +0100
committerBruno Martins <bgcngm@gmail.com>2018-11-20 12:32:17 +0000
commitbec37cd5493c672007ef88f03d77e02d2a708176 (patch)
treefd986d8b14e37bc8ff41679151f215895c53d4cc
parent13a0c19a58fab5655c0fdee593e1108d38a853ad (diff)
downloadandroid_packages_apps_Snap-bec37cd5493c672007ef88f03d77e02d2a708176.tar.gz
android_packages_apps_Snap-bec37cd5493c672007ef88f03d77e02d2a708176.tar.bz2
android_packages_apps_Snap-bec37cd5493c672007ef88f03d77e02d2a708176.zip
Snap: check tags before using them
MessageQueue-JNI: java.lang.IllegalArgumentException: Could not find tag for key 'org.codeaurora.qcamera3.saturation.use_saturation') Change-Id: Ia42c67552f9d4574e5f86af2ac5aea853198d0ed
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java6
-rwxr-xr-xsrc/com/android/camera/util/VendorTagUtil.java2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 183b66a53..9dcee8b75 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -5208,6 +5208,8 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void applyInstantAEC(CaptureRequest.Builder request) {
+ if (!VendorTagUtil.isSupported(request, CaptureModule.INSTANT_AEC_MODE))
+ return;
String value = mSettingsManager.getValue(SettingsManager.KEY_INSTANT_AEC);
if (value == null || value.equals("0"))
return;
@@ -5216,6 +5218,8 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void applySaturationLevel(CaptureRequest.Builder request) {
+ if (!VendorTagUtil.isSupported(request, CaptureModule.SATURATION))
+ return;
String value = mSettingsManager.getValue(SettingsManager.KEY_SATURATION_LEVEL);
if (value != null) {
int intValue = Integer.parseInt(value);
@@ -5300,6 +5304,8 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void applyHistogram(CaptureRequest.Builder request) {
+ if (!VendorTagUtil.isSupported(request, CaptureModule.histMode))
+ return;
String value = mSettingsManager.getValue(SettingsManager.KEY_STATS_VISUALIZER_VALUE);
if (value != null ) {
if (value.equals("3")) {
diff --git a/src/com/android/camera/util/VendorTagUtil.java b/src/com/android/camera/util/VendorTagUtil.java
index b2efbfa54..0cc6359ec 100755
--- a/src/com/android/camera/util/VendorTagUtil.java
+++ b/src/com/android/camera/util/VendorTagUtil.java
@@ -71,7 +71,7 @@ public class VendorTagUtil {
private static final int MANUAL_WB_CCT_MODE = 1;
private static final int MANUAL_WB_GAINS_MODE = 2;
- private static boolean isSupported(CaptureRequest.Builder builder,
+ public static boolean isSupported(CaptureRequest.Builder builder,
CaptureRequest.Key<?> key) {
boolean supported = true;
try {