summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/WideAnglePanoramaModule.java
diff options
context:
space:
mode:
authorKerong Sui <ksui@codeaurora.org>2014-03-17 11:38:34 +0800
committerKerong Sui <ksui@codeaurora.org>2014-03-31 11:37:17 +0800
commit77c1b6685d0f3aef6be75ebea9aa591dd4164d08 (patch)
tree5d8dd51748ef54d22e4cac8514545c616f912e12 /src/com/android/camera/WideAnglePanoramaModule.java
parentedea332aa8a58edf4af635a2da31585f45998366 (diff)
downloadandroid_packages_apps_Snap-77c1b6685d0f3aef6be75ebea9aa591dd4164d08.tar.gz
android_packages_apps_Snap-77c1b6685d0f3aef6be75ebea9aa591dd4164d08.tar.bz2
android_packages_apps_Snap-77c1b6685d0f3aef6be75ebea9aa591dd4164d08.zip
Camera2: save the picture when rotate the device
If we rotate the device, the panoroma can not mosaic image, so if we rotate the device, we should stop capture immediately and save the previous capture frames. Change-Id: I4ba304957d4083b4ae58c084239d6dc3d7f4dc89 CRs-fixed: 627105
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaModule.java')
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index d8d980533..b99b31537 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -524,9 +524,11 @@ public class WideAnglePanoramaModule
float progressX, float progressY) {
float accumulatedHorizontalAngle = progressX * mHorizontalViewAngle;
float accumulatedVerticalAngle = progressY * mVerticalViewAngle;
+ boolean isRotated = !(mDeviceOrientationAtCapture == mDeviceOrientation);
if (isFinished
|| (Math.abs(accumulatedHorizontalAngle) >= DEFAULT_SWEEP_ANGLE)
- || (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE)) {
+ || (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE)
+ || isRotated) {
stopCapture(false);
} else {
float panningRateXInDegree = panningRateX * mHorizontalViewAngle;