summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2018-06-25 16:18:45 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-27 01:03:05 -0700
commit18c424628cc90556076ef18b4b5284a6e04add0b (patch)
treeedaf333d84c209909706437267aff3f913ffb260 /src/com/android/camera/util
parent0e830bed24cb87b40a0f5a3d0a38ea9b7c667783 (diff)
downloadandroid_packages_apps_Snap-18c424628cc90556076ef18b4b5284a6e04add0b.tar.gz
android_packages_apps_Snap-18c424628cc90556076ef18b4b5284a6e04add0b.tar.bz2
android_packages_apps_Snap-18c424628cc90556076ef18b4b5284a6e04add0b.zip
SnapdragonCamera: Modify the previewSize
(1) When display is QHD/QHD+, set previewSize is 1920x1440. (2) When display is 2160x1080, set previewSize is 1440x1080. CRs-Fixed: 2266854 Change-Id: I760aa13eb3f0e5c6a3131404597e708a28fba993
Diffstat (limited to 'src/com/android/camera/util')
-rwxr-xr-xsrc/com/android/camera/util/CameraUtil.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 087db1deb..34787e4d8 100755
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -589,6 +589,7 @@ public class CameraUtil {
// new overlay will be created before the old one closed, which causes
// an exception. For now, just get the screen size.
Point point = getDefaultDisplaySize(currentActivity, new Point());
+ final double ratio_4_3 = (double)4/3;
int targetHeight = Math.min(point.x, point.y);
double minDiff = targetHeight;
// Try to find an size match aspect ratio and size
@@ -598,7 +599,11 @@ 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);
if (heightDiff < minDiff) {