summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuman Mukherjee <sumam@codeaurora.org>2018-01-11 14:28:21 +0530
committerArne Coucheron <arco68@gmail.com>2018-05-19 05:56:09 +0200
commit2f424d1d1abec4fcd77c020f0df0f72bb5a768dc (patch)
treeb034bb9ae1b8f7309d076cb82ceba00e94e4bffb
parent06b3638335e1e4cfb2afe7b5393c9253bed1d638 (diff)
downloadandroid_packages_apps_Snap-2f424d1d1abec4fcd77c020f0df0f72bb5a768dc.zip
android_packages_apps_Snap-2f424d1d1abec4fcd77c020f0df0f72bb5a768dc.tar.gz
android_packages_apps_Snap-2f424d1d1abec4fcd77c020f0df0f72bb5a768dc.tar.bz2
SnapdragonCamera: Change static nature for persist flag
Issue: Due to static declaration of flip flags, flip effect is not getting reflected until the application will get stopped. Change-Id: If47653a365c840ce262fe9c270472cf41e7dbdba Fix: In place of static, use flip flags as normal variable.
-rw-r--r--src/com/android/camera/PhotoModule.java8
-rw-r--r--src/com/android/camera/VideoModule.java9
-rw-r--r--src/com/android/camera/util/PersistUtil.java12
3 files changed, 17 insertions, 12 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 1783237..291b95c 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -4057,9 +4057,11 @@ public class PhotoModule
//value: 1 - FLIP_MODE_H
//value: 2 - FLIP_MODE_V
//value: 3 - FLIP_MODE_VH
- int preview_flip_value = PersistUtil.getPreviewFlip();
- int video_flip_value = PersistUtil.getVideoFlip();
- int picture_flip_value = PersistUtil.getPictureFlip();
+ PersistUtil myUtil = new PersistUtil();
+ int preview_flip_value = myUtil.getPreviewFlip();
+ int video_flip_value = myUtil.getVideoFlip();
+ int picture_flip_value = myUtil.getPictureFlip();
+
int rotation = CameraUtil.getJpegRotation(mCameraId, mOrientation);
mParameters.setRotation(rotation);
if (rotation == 90 || rotation == 270) {
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 28766f4..1473248 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2437,9 +2437,12 @@ public class VideoModule implements CameraModule,
//value: 1 - FLIP_MODE_H
//value: 2 - FLIP_MODE_V
//value: 3 - FLIP_MODE_VH
- int preview_flip_value = PersistUtil.getPreviewFlip();
- int video_flip_value = PersistUtil.getVideoFlip();
- int picture_flip_value = PersistUtil.getPictureFlip();
+
+ PersistUtil myUtil = new PersistUtil();
+ int preview_flip_value = myUtil.getPreviewFlip();
+ int video_flip_value = myUtil.getVideoFlip();
+ int picture_flip_value = myUtil.getPictureFlip();
+
int rotation = CameraUtil.getJpegRotation(mCameraId, mOrientation);
mParameters.setRotation(rotation);
if (rotation == 90 || rotation == 270) {
diff --git a/src/com/android/camera/util/PersistUtil.java b/src/com/android/camera/util/PersistUtil.java
index c0f4455..1a46018 100644
--- a/src/com/android/camera/util/PersistUtil.java
+++ b/src/com/android/camera/util/PersistUtil.java
@@ -107,11 +107,11 @@ public class PersistUtil {
SystemProperties.getBoolean("persist.vendor.camera.cs.dumpdepth", false);
private static final boolean PERSIST_DISABLE_QCOM_MISC_SETTING =
SystemProperties.getBoolean("persist.vendor.camera.qcom.misc.disable", false);
- private static final int PREVIEW_FLIP_VALUE =
+ private final int PREVIEW_FLIP_VALUE =
SystemProperties.getInt("persist.vendor.debug.camera.preview.flip", 0);
- private static final int PERSIST_VIDEO_FLIP_VALUE =
+ private final int PERSIST_VIDEO_FLIP_VALUE =
SystemProperties.getInt("persist.vendor.debug.camera.video.flip", 0);
- private static final int PERSIST_PICTURE_FLIP_VALUE =
+ private final int PERSIST_PICTURE_FLIP_VALUE =
SystemProperties.getInt("persist.vendor.debug.camera.picture.flip", 0);
private static final boolean PERSIST_YV_12_FORMAT_ENABLED =
SystemProperties.getBoolean("persist.vendor.camera.debug.camera.yv12", false);
@@ -268,15 +268,15 @@ public class PersistUtil {
return PERSIST_DISABLE_QCOM_MISC_SETTING;
}
- public static int getPreviewFlip() {
+ public int getPreviewFlip() {
return PREVIEW_FLIP_VALUE;
}
- public static int getVideoFlip() {
+ public int getVideoFlip() {
return PERSIST_VIDEO_FLIP_VALUE;
}
- public static int getPictureFlip() {
+ public int getPictureFlip() {
return PERSIST_PICTURE_FLIP_VALUE;
}