summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util/CameraUtil.java
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2017-12-26 16:28:30 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-01-15 01:21:06 -0800
commit50d1984acd6c27c3286bdb14b8135e93e6e3cad1 (patch)
tree450d665a4c46b9a6982af76ca56d1380dec1c66d /src/com/android/camera/util/CameraUtil.java
parent2fdb251817064f39c23a1404617cdc3a613d3688 (diff)
downloadandroid_packages_apps_Snap-50d1984acd6c27c3286bdb14b8135e93e6e3cad1.tar.gz
android_packages_apps_Snap-50d1984acd6c27c3286bdb14b8135e93e6e3cad1.tar.bz2
android_packages_apps_Snap-50d1984acd6c27c3286bdb14b8135e93e6e3cad1.zip
SnapdragonCamera:Avoid black preview
Some resolution is not in regular ratio and will cause the preview to be larger than screen. Ensure preview size is not larger than screen to avoid black preview. Change-Id: I19a916520b9aac794dda7d6c11f547ec6ce2a41d CRs-Fixed: 2163684
Diffstat (limited to 'src/com/android/camera/util/CameraUtil.java')
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/util/CameraUtil.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 5c55422e8..b0f58b5ce 100644..100755
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -573,7 +573,6 @@ public class CameraUtil {
if (sizes == null) return -1;
int optimalSizeIndex = -1;
- double minDiff = Double.MAX_VALUE;
// Because of bugs of overlay and layout, we sometimes will try to
// layout the viewfinder in the portrait orientation and thus get the
@@ -582,6 +581,7 @@ public class CameraUtil {
// an exception. For now, just get the screen size.
Point point = getDefaultDisplaySize(currentActivity, new Point());
int targetHeight = Math.min(point.x, point.y);
+ double minDiff = targetHeight;
// Try to find an size match aspect ratio and size
for (int i = 0; i < sizes.length; i++) {
Point size = sizes[i];