summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2019-11-20 10:52:39 +0800
committerLuK1337 <priv.luk@gmail.com>2019-11-21 01:31:03 +0100
commit227aeca12b620f096d6810252714099521ace473 (patch)
treeadf748a1127367728eba99f7ae0d0d146337c3f6
parent29bccbb0a28ca24b39fb095ad00cdeb596728842 (diff)
downloadandroid_packages_apps_Snap-227aeca12b620f096d6810252714099521ace473.zip
android_packages_apps_Snap-227aeca12b620f096d6810252714099521ace473.tar.gz
android_packages_apps_Snap-227aeca12b620f096d6810252714099521ace473.tar.bz2
Snap: Fix getting supported ISO with legacy HAL
* org.codeaurora.qcamera3.iso_exp_priority.iso_available_modes is QCOM specific vendor tag and not implemented in legacy HALs. * Restore pre-17.0 behavior by falling back to AOSP camera characteristics Change-Id: I299e7bfb867496c63ec873ea4cea29b0b8bb595f
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 3d2c465..b3cf50e 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -1882,14 +1882,14 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
private List<String> getSupportedIso(int cameraId) {
+ CameraCharacteristics cameraCharacteristics = mCharacteristics.get(cameraId);
List<String> supportedIso = new ArrayList<>();
- try {
- int[] range = mCharacteristics.get(cameraId).get(
- CaptureModule.ISO_AVAILABLE_MODES);
- supportedIso.add("auto");
+ supportedIso.add("auto");
- if (range != null) {
- for (int iso : range) {
+ try {
+ int[] modes = cameraCharacteristics.get(CaptureModule.ISO_AVAILABLE_MODES);
+ if (modes != null) {
+ for (int iso : modes) {
for (String key : KEY_ISO_INDEX.keySet()) {
if (KEY_ISO_INDEX.get(key).equals(iso)) {
supportedIso.add(key);
@@ -1903,6 +1903,21 @@ public class SettingsManager implements ListMenu.SettingsListener {
Log.w(TAG, "Supported ISO_AVAILABLE_MODES is null.");
} catch (IllegalArgumentException e) {
Log.w(TAG, "IllegalArgumentException Supported ISO_AVAILABLE_MODES is wrong.");
+
+ Range<Integer> range = mCharacteristics.get(cameraId).get(
+ CameraCharacteristics.SENSOR_INFO_SENSITIVITY_RANGE);
+ if (range != null) {
+ int max = range.getUpper();
+ int value = 50;
+ while (value <= max) {
+ if (range.contains(value)) {
+ supportedIso.add(String.valueOf(value));
+ }
+ value += 50;
+ }
+ } else {
+ Log.w(TAG, "Supported ISO range is null.");
+ }
}
return supportedIso;