summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuK1337 <priv.luk@gmail.com>2017-03-19 09:43:33 (GMT)
committerRashed Abdel-Tawab <rashed@linux.com>2017-07-13 01:01:22 (GMT)
commit0dbf891c5108359579f31ecf6a2d0e33bae7edba (patch)
tree532d4985b5ece6539a4e863f1f5e84cc961d3d6d
parenta7eb8d6a44311ccaf1d7ac595d2089a32a5e611d (diff)
downloadandroid_packages_apps_Snap-0dbf891c5108359579f31ecf6a2d0e33bae7edba.zip
android_packages_apps_Snap-0dbf891c5108359579f31ecf6a2d0e33bae7edba.tar.gz
android_packages_apps_Snap-0dbf891c5108359579f31ecf6a2d0e33bae7edba.tar.bz2
Add overlay for restarting camera preview for additional cameras
Change-Id: I95eb7237b101b73d66fe231a11d0c8d5156bfe47
-rw-r--r--res/values/config.xml3
-rw-r--r--src/com/android/camera/PhotoModule.java7
2 files changed, 9 insertions, 1 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 26e64c3..90c007e 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -47,6 +47,9 @@
<!-- Restart preview for front camera onPictureTaken -->
<bool name="front_camera_restart_preview_onPictureTaken">false</bool>
+ <!-- Restart preview for additional camera onPictureTaken -->
+ <bool name="additional_camera_restart_preview_onPictureTaken">false</bool>
+
<!-- Force use a specific preview-size
Example: 1920x1080 -->
<string name="preview_size_for_photo"></string>
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index fb4db8c..1f9529a 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1382,16 +1382,21 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
boolean backCameraRestartPreviewOnPictureTaken = false;
boolean frontCameraRestartPreviewOnPictureTaken = false;
+ boolean additionalCameraRestartPreviewOnPictureTaken = false;
backCameraRestartPreviewOnPictureTaken =
mActivity.getResources().getBoolean(R.bool.back_camera_restart_preview_onPictureTaken);
frontCameraRestartPreviewOnPictureTaken =
mActivity.getResources().getBoolean(R.bool.front_camera_restart_preview_onPictureTaken);
+ additionalCameraRestartPreviewOnPictureTaken =
+ mActivity.getResources().getBoolean(R.bool.additional_camera_restart_preview_onPictureTaken);
CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId];
if ((info.facing == CameraInfo.CAMERA_FACING_BACK
&& backCameraRestartPreviewOnPictureTaken && (mCameraState != LONGSHOT))
|| (info.facing == CameraInfo.CAMERA_FACING_FRONT
- && frontCameraRestartPreviewOnPictureTaken && (mCameraState != LONGSHOT))) {
+ && frontCameraRestartPreviewOnPictureTaken && (mCameraState != LONGSHOT))
+ || (info.facing > CameraInfo.CAMERA_FACING_FRONT
+ && additionalCameraRestartPreviewOnPictureTaken && (mCameraState != LONGSHOT))) {
needRestartPreview = true;
}