diff options
author | Alan Newberger <alann@google.com> | 2014-10-05 12:41:11 -0700 |
---|---|---|
committer | Alan Newberger <alann@google.com> | 2014-10-05 12:41:11 -0700 |
commit | 90e75d1f90b85e11f6905966ea28d59916935c68 (patch) | |
tree | 282b4340217c201ea83bca2c1fafaabd5b043b2a /camera2 | |
parent | 698997b9ef47f215350f03c0289f291846cd3604 (diff) | |
download | android_frameworks_ex-90e75d1f90b85e11f6905966ea28d59916935c68.tar.gz android_frameworks_ex-90e75d1f90b85e11f6905966ea28d59916935c68.tar.bz2 android_frameworks_ex-90e75d1f90b85e11f6905966ea28d59916935c68.zip |
Check isZoomSupported before any zoom ratio calculations.
Per API doc, isZoomeSupported should be checked before calling
getZoomRatios or getMaxZoom. Moving zoom calculation into
isZoomSupported check fixed crash in front camera with no zoom
support, where a HAL/fwk returns a null list of zoom ratios.
Bug: 17863266
Change-Id: I80b5f7a431e7bbe4d50e5d062628e38eda3fd0a6
Diffstat (limited to 'camera2')
-rw-r--r-- | camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraCapabilities.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraCapabilities.java b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraCapabilities.java index 84b44e6..9892d4a 100644 --- a/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraCapabilities.java +++ b/camera2/portability/src/com/android/ex/camera2/portability/AndroidCameraCapabilities.java @@ -47,7 +47,6 @@ class AndroidCameraCapabilities extends CameraCapabilities { mPreferredPreviewSizeForVideo = new Size(p.getPreferredPreviewSizeForVideo()); mSupportedPreviewFormats.addAll(p.getSupportedPreviewFormats()); mSupportedPhotoFormats.addAll(p.getSupportedPictureFormats()); - mMaxZoomRatio = p.getZoomRatios().get(p.getMaxZoom()) / ZOOM_MULTIPLIER; mHorizontalViewAngle = p.getHorizontalViewAngle(); mVerticalViewAngle = p.getVerticalViewAngle(); buildPreviewFpsRange(p); @@ -60,6 +59,7 @@ class AndroidCameraCapabilities extends CameraCapabilities { buildWhiteBalances(p); if (p.isZoomSupported()) { + mMaxZoomRatio = p.getZoomRatios().get(p.getMaxZoom()) / ZOOM_MULTIPLIER; mSupportedFeatures.add(Feature.ZOOM); } if (p.isVideoSnapshotSupported()) { |