diff options
author | jinwu <jinwu@codeaurora.org> | 2018-09-21 18:38:55 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-09-25 00:04:20 -0700 |
commit | c5acbc82c37748cddd4844a497dbe2091684d1ea (patch) | |
tree | 6526fa39230f137d53a08ed397c0277f4428e127 | |
parent | cbc0272fb68ce236479508e5e9929f878ff2a6ca (diff) | |
download | android_packages_apps_Snap-c5acbc82c37748cddd4844a497dbe2091684d1ea.tar.gz android_packages_apps_Snap-c5acbc82c37748cddd4844a497dbe2091684d1ea.tar.bz2 android_packages_apps_Snap-c5acbc82c37748cddd4844a497dbe2091684d1ea.zip |
SnapdragonCamera: Fix mistakes of judgment of limit 1080P
Fix mistakes of judgment of limit previewSize is 1080P.
CRs-Fixed: 2315431
Change-Id: I05970ab3bea384869fcf5aa36b8e131a0d937b49
-rwxr-xr-x | src/com/android/camera/util/CameraUtil.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index 34787e4d8..854b5bdfa 100755 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -576,7 +576,7 @@ public class CameraUtil { public static int getOptimalPreviewSize(Activity currentActivity, Point[] sizes, double targetRatio) { // TODO(andyhuibers): Don't hardcode this but use device's measurements. - final int MAX_ASPECT_HEIGHT = 1080; + final int MAX_ASPECT_HEIGHT = 1440; // Use a very small tolerance because we want an exact match. final double ASPECT_TOLERANCE = 0.01; if (sizes == null) return -1; @@ -599,10 +599,9 @@ public class CameraUtil { if (Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; // Count sizes with height <= 1080p to mimic camera1 api behavior. + if (size.y > MAX_ASPECT_HEIGHT) continue; if (ratio_4_3 == targetRatio) { if (size.y > minDiff) continue; - } else { - if (size.y > MAX_ASPECT_HEIGHT) continue; } double heightDiff = Math.abs(size.y - targetHeight); |