diff options
-rw-r--r-- | res/values/config.xml | 6 | ||||
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index b6f39052a..de0ca1cf6 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -28,6 +28,12 @@ of the fullscreen pano preview. --> <bool name="enable_warped_pano_preview">true</bool> + <!-- Restart preview for back camera onPictureTaken --> + <bool name="back_camera_restart_preview_onPictureTaken">false</bool> + + <!-- Restart preview for front camera onPictureTaken --> + <bool name="front_camera_restart_preview_onPictureTaken">false</bool> + <!-- Set's manufacturer specific parameters on startup. Example: lge-camera=1;cam-mode=0 --> <string name="manufacturer_key_values"></string> diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 855ebc3d5..68a5b5032 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -70,6 +70,7 @@ import android.widget.SeekBar.OnSeekBarChangeListener; import android.widget.LinearLayout; import android.widget.TextView; +import com.android.camera.app.CameraApp; import com.android.camera.CameraManager.CameraAFCallback; import com.android.camera.CameraManager.CameraAFMoveCallback; import com.android.camera.CameraManager.CameraPictureCallback; @@ -273,6 +274,8 @@ public class PhotoModule private byte[] mLastJpegData; private int mLastJpegOrientation = 0; + private static Context mApplicationContext; + private boolean mIsBokehMode = false; private TextView mBokehTipText; private boolean mDepthSuccess = false; @@ -931,6 +934,8 @@ public class PhotoModule return; } + mApplicationContext = CameraApp.getContext(); + // Initialize location service. boolean recordLocation = RecordLocationPreference.get(mPreferences, CameraSettings.KEY_RECORD_LOCATION); @@ -1459,6 +1464,18 @@ public class PhotoModule && (mCameraState != LONGSHOT) && (mSnapshotMode != CameraInfoWrapper.CAMERA_SUPPORT_MODE_ZSL) && (mReceivedSnapNum == mBurstSnapNum); + + boolean backCameraRestartPreviewOnPictureTaken = + mApplicationContext.getResources().getBoolean(R.bool.back_camera_restart_preview_onPictureTaken); + boolean frontCameraRestartPreviewOnPictureTaken = + mApplicationContext.getResources().getBoolean(R.bool.front_camera_restart_preview_onPictureTaken); + + CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId]; + if ((info.facing == CameraInfo.CAMERA_FACING_BACK && backCameraRestartPreviewOnPictureTaken) + || (info.facing == CameraInfo.CAMERA_FACING_FRONT && frontCameraRestartPreviewOnPictureTaken)) { + needRestartPreview = true; + } + if (needRestartPreview) { setupPreview(); if (CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE.equals( @@ -1499,7 +1516,6 @@ public class PhotoModule .findPreference(CameraSettings.KEY_SELFIE_MIRROR); if (selfieMirrorPref != null && selfieMirrorPref.getValue() != null && selfieMirrorPref.getValue().equalsIgnoreCase("enable")) { - CameraInfo info = CameraHolder.instance().getCameraInfo()[mCameraId]; jpegData = flipJpeg(jpegData, info.orientation, orientation); jpegData = addExifTags(jpegData, orientation); } |