From 3b1cc30253e93f10458e5312a788de90710cac36 Mon Sep 17 00:00:00 2001 From: jinwu Date: Fri, 21 Sep 2018 18:15:19 +0800 Subject: SnapdragonCamera:ZSL size Sort the output sizes of ZSl and set the max size for ZSL to ensure that the image will not be cropped. Change-Id: Iba7e924b0ee7819586a7b190f5ffda5703f05ffc CRs-Fixed: 2290545 --- src/com/android/camera/CaptureModule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 7bfee3041..2e70b53e9 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -137,6 +137,8 @@ import java.io.OutputStream; import java.nio.ByteBuffer; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; import java.util.Date; import java.util.LinkedList; import java.util.List; @@ -3778,7 +3780,9 @@ public class CaptureModule implements CameraModule, PhotoController, mPictureSize = parsePictureSize(pictureSize); Size[] prevSizes = mSettingsManager.getSupportedOutputSize(getMainCameraId(), SurfaceHolder.class); - mSupportedMaxPictureSize = prevSizes[0]; + List prevSizeList = Arrays.asList(prevSizes); + prevSizeList.sort((o1,o2) -> o2.getWidth()*o2.getHeight() - o1.getWidth()*o1.getHeight()); + mSupportedMaxPictureSize = prevSizeList.get(0); Size[] rawSize = mSettingsManager.getSupportedOutputSize(getMainCameraId(), ImageFormat.RAW10); mSupportedRawPictureSize = rawSize[0]; -- cgit v1.2.3