summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2018-01-04 23:13:53 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:45 +0100
commit289bdf1e3b25af843a945de64548e19e9d759bcb (patch)
treee76ce2adfbfa769d3671d865ea06f2e49036d1d9
parent860bd020b0414c3d52da8bcde260fbbbb20a9359 (diff)
downloadandroid_packages_apps_Snap-289bdf1e3b25af843a945de64548e19e9d759bcb.zip
android_packages_apps_Snap-289bdf1e3b25af843a945de64548e19e9d759bcb.tar.gz
android_packages_apps_Snap-289bdf1e3b25af843a945de64548e19e9d759bcb.tar.bz2
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
-rw-r--r--src/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 61aaf9d..687d219 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -4067,6 +4067,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;
@@ -4075,6 +4077,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);
@@ -4091,6 +4095,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_HISTOGRAM);
if (value != null ) {
if (value.equals("enable")){
diff --git a/src/com/android/camera/util/VendorTagUtil.java b/src/com/android/camera/util/VendorTagUtil.java
index 9c2f6cc..32fc7da 100644
--- a/src/com/android/camera/util/VendorTagUtil.java
+++ b/src/com/android/camera/util/VendorTagUtil.java
@@ -54,7 +54,7 @@ public class VendorTagUtil {
Long.class);
- private static boolean isSupported(CaptureRequest.Builder builder,
+ public static boolean isSupported(CaptureRequest.Builder builder,
CaptureRequest.Key<?> key) {
boolean supported = true;
try {