summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util
diff options
context:
space:
mode:
authorAlan Newberger <alann@google.com>2015-01-06 11:34:24 -0800
committerAlan Newberger <alann@google.com>2015-01-06 11:34:24 -0800
commit522d87380bdc8f4b8cdfe4b6f8337911d2cbc07f (patch)
tree7e724d9d3384a9f8a53c9473c6490c900d811b25 /src/com/android/camera/util
parent1408a7844cddfa357de224233c3181318f824fc2 (diff)
downloadandroid_packages_apps_Camera2-522d87380bdc8f4b8cdfe4b6f8337911d2cbc07f.tar.gz
android_packages_apps_Camera2-522d87380bdc8f4b8cdfe4b6f8337911d2cbc07f.tar.bz2
android_packages_apps_Camera2-522d87380bdc8f4b8cdfe4b6f8337911d2cbc07f.zip
Adjust aspect ratio matching threshold for all devices
Broadening a fix from Glacier now that we have time to test across devices. Bug: 18241645 Change-Id: Ic3a65a659009d0301255b608d4540bd15e9bd0fb
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r--src/com/android/camera/util/ApiHelper.java1
-rw-r--r--src/com/android/camera/util/CameraUtil.java15
2 files changed, 5 insertions, 11 deletions
diff --git a/src/com/android/camera/util/ApiHelper.java b/src/com/android/camera/util/ApiHelper.java
index 624cbf264..046a9f9b4 100644
--- a/src/com/android/camera/util/ApiHelper.java
+++ b/src/com/android/camera/util/ApiHelper.java
@@ -70,7 +70,6 @@ public class ApiHelper {
public static final boolean IS_NEXUS_9 = "htc".equalsIgnoreCase(Build.MANUFACTURER)
&& ("flounder".equalsIgnoreCase(Build.DEVICE)
|| "flounder_lte".equalsIgnoreCase(Build.DEVICE));
- public static final boolean IS_HTC = "htc".equalsIgnoreCase(Build.MANUFACTURER);
public static final boolean HAS_CAMERA_2_API = isLOrHigher();
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 71e15cba6..d61703850 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -486,16 +486,11 @@ public class CameraUtil {
*/
public static int getOptimalPreviewSizeIndex(Context context,
List<Size> sizes, double targetRatio) {
- // Use a very small tolerance because we want an exact match.
- final double aspectRatioTolerance;
- // HTC 4:3 ratios is over .01 from true 4:3, targeted fix for those
- // devices here, see b/18241645
- if (ApiHelper.IS_HTC && targetRatio > 1.3433 && targetRatio < 1.35) {
- Log.w(TAG, "4:3 ratio out of normal tolerance, increasing tolerance to 0.02");
- aspectRatioTolerance = 0.02;
- } else {
- aspectRatioTolerance = 0.01;
- }
+ // Use a very small tolerance because we want an exact match. HTC 4:3
+ // ratios is over .01 from true 4:3, so this value must be above .01,
+ // see b/18241645.
+ final double aspectRatioTolerance = 0.02;
+
return getOptimalPreviewSizeIndex(context, sizes, targetRatio, aspectRatioTolerance);
}