Merge "fix camera app cannot handle intent extras.CAMERA_FACING" into camera-SnapdragonCamera.lnx.2.0
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 9e340a0..3ea6676 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1899,12 +1899,11 @@
     private void takePicture() {
         Log.d(TAG, "takePicture");
         mUI.enableShutter(false);
-        if ((mSettingsManager.isZSLInHALEnabled() &&
+        if ((mSettingsManager.isZSLInHALEnabled() || isActionImageCapture()) &&
                 !isFlashOn(getMainCameraId()) && (mPreviewCaptureResult != null &&
                 mPreviewCaptureResult.get(CaptureResult.CONTROL_AE_STATE) !=
                      CameraMetadata.CONTROL_AE_STATE_FLASH_REQUIRED &&
-                mPreviewCaptureResult.getRequest().get(CaptureRequest.CONTROL_AE_LOCK) != Boolean.TRUE)) ||
-                isActionImageCapture()) {
+                mPreviewCaptureResult.getRequest().get(CaptureRequest.CONTROL_AE_LOCK) != Boolean.TRUE)) {
             takeZSLPictureInHAL();
         } else {
             if (isBackCamera()) {
@@ -3545,17 +3544,13 @@
             mFrameProcessor.onOpen(getFrameProcFilterId(), mPreviewSize);
         }
 
-        if(mPostProcessor.isZSLEnabled()) {
+        if(mPostProcessor.isZSLEnabled() && !isActionImageCapture()) {
             mChosenImageFormat = ImageFormat.PRIVATE;
         } else if(mPostProcessor.isFilterOn() || getFrameFilters().size() != 0 || mPostProcessor.isSelfieMirrorOn()) {
             mChosenImageFormat = ImageFormat.YUV_420_888;
         } else {
             mChosenImageFormat = ImageFormat.JPEG;
         }
-        // if intent action is ACTION_IMAGE_CAPTURE, use HAL-ZSL to capture
-        if (isActionImageCapture()) {
-            mChosenImageFormat = ImageFormat.JPEG;
-        }
         setUpCameraOutputs(mChosenImageFormat);
 
     }