diff options
author | Wilhelm Fitzpatrick <rafial@cyngn.com> | 2014-11-14 16:31:35 -0800 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-11-02 12:24:52 -0700 |
commit | c76e6d8a2768487407fd5db3d1e917bc35f22c80 (patch) | |
tree | 0b8c0e1d21e79dc90560f8b4d8f49724fb39d84d /src/com/android/camera/SettingsManager.java | |
parent | e4351681fcb22d2b08562bf14ebeb32573e41d7f (diff) | |
download | android_packages_apps_Snap-c76e6d8a2768487407fd5db3d1e917bc35f22c80.tar.gz android_packages_apps_Snap-c76e6d8a2768487407fd5db3d1e917bc35f22c80.tar.bz2 android_packages_apps_Snap-c76e6d8a2768487407fd5db3d1e917bc35f22c80.zip |
CameraNext: dynamically generate available photo resolutions
Instead of depending on a large matching table, generated the list
of picture sizes to show to the user directly from the supported
list returned by the camera. The list is filtered to remove
uselessly small resolutions on modern devices, to group resolutions
by aspect ratio, and to filter out fairly similar sizes.
Change-Id: I47a67a89786543baec133cf7e71df9819793ebac
Diffstat (limited to 'src/com/android/camera/SettingsManager.java')
-rw-r--r-- | src/com/android/camera/SettingsManager.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java index 374c6eb2b..7ac4257ee 100644 --- a/src/com/android/camera/SettingsManager.java +++ b/src/com/android/camera/SettingsManager.java @@ -517,9 +517,9 @@ public class SettingsManager implements ListMenu.SettingsListener { if (cameraIdPref != null) buildCameraId(); if (pictureSize != null) { - CameraSettings.filterUnsupportedOptions(mPreferenceGroup, - pictureSize, getSupportedPictureSize(cameraId)); - CameraSettings.filterSimilarPictureSize(mPreferenceGroup, pictureSize); + CameraSettings.formatPictureSizes(pictureSize, + getSupportedPictureSize(cameraId), mContext); + CameraSettings.resetIfInvalid(pictureSize); } if (exposure != null) buildExposureCompensation(cameraId); @@ -836,21 +836,21 @@ public class SettingsManager implements ListMenu.SettingsListener { mValuesMap.get(KEY_FLASH_MODE) != null; } - private List<String> getSupportedPictureSize(int cameraId) { + private List<Size> getSupportedPictureSize(int cameraId) { StreamConfigurationMap map = mCharacteristics.get(cameraId).get( CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP); Size[] sizes = map.getOutputSizes(ImageFormat.JPEG); - List<String> res = new ArrayList<>(); + List<Size> res = new ArrayList<>(); if (sizes != null) { for (int i = 0; i < sizes.length; i++) { - res.add(sizes[i].toString()); + res.add(sizes[i]); } } Size[] highResSizes = map.getHighResolutionOutputSizes(ImageFormat.JPEG); if (highResSizes != null) { for (int i = 0; i < highResSizes.length; i++) { - res.add(highResSizes[i].toString()); + res.add(highResSizes[i]); } } |