summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoUI.java
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-12-28 13:47:57 +0700
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commite0b3fd627e41996f91e4629bf08071344a6a75e3 (patch)
treea82b43ca5b30719c5e59aca5456c79f599c626f8 /src/com/android/camera/VideoUI.java
parentb376ee139d2fc12f8b829388539605d47a4ebb4e (diff)
downloadandroid_packages_apps_Snap-e0b3fd627e41996f91e4629bf08071344a6a75e3.tar.gz
android_packages_apps_Snap-e0b3fd627e41996f91e4629bf08071344a6a75e3.tar.bz2
android_packages_apps_Snap-e0b3fd627e41996f91e4629bf08071344a6a75e3.zip
Camera: fix preview for landscape devices
Landscape devices have broken preview because PORTRAIT mode is being abused to check for screen rotation. Use proper rotation check to fix. Ported from cm-10.2 Change-Id: I75588cbce9843e180e4be7591f6a43bcec788506
Diffstat (limited to 'src/com/android/camera/VideoUI.java')
-rwxr-xr-xsrc/com/android/camera/VideoUI.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 75c9ab1db..02db6b390 100755
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -382,9 +382,7 @@ public class VideoUI implements PieRenderer.PieListener,
} else {
ratio = (float) height / width;
}
- if (mOrientationResize &&
- mActivity.getResources().getConfiguration().orientation
- != Configuration.ORIENTATION_PORTRAIT) {
+ if (mOrientationResize && CameraUtil.isScreenRotated(mActivity)) {
ratio = 1 / ratio;
}
@@ -727,9 +725,7 @@ public class VideoUI implements PieRenderer.PieListener,
}
public void setAspectRatio(double ratio) {
- if (mOrientationResize &&
- mActivity.getResources().getConfiguration().orientation
- != Configuration.ORIENTATION_PORTRAIT) {
+ if (mOrientationResize && CameraUtil.isScreenRotated(mActivity)) {
ratio = 1 / ratio;
}