diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2018-11-30 10:29:40 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-11-30 10:29:40 -0800 |
commit | a9793c5596eeeeb4d196f6a4019a459506d0f730 (patch) | |
tree | 65ada5b85dbf35f8ac9e84517c877f00b77ca449 /src | |
parent | 041f347e575da3bb725fdadaa81a83e590b5cfd2 (diff) | |
parent | 761322c4147e1c5d6ebe43f583c1bc4a377731ff (diff) | |
download | android_packages_apps_Snap-a9793c5596eeeeb4d196f6a4019a459506d0f730.tar.gz android_packages_apps_Snap-a9793c5596eeeeb4d196f6a4019a459506d0f730.tar.bz2 android_packages_apps_Snap-a9793c5596eeeeb4d196f6a4019a459506d0f730.zip |
Merge "SnapdragonCamera: Use HAL-ZSL to capture in ACTION_IMAGE_CAPTURE" into camera-SnapdragonCamera.lnx.2.0
Diffstat (limited to 'src')
-rwxr-xr-x | src/com/android/camera/CameraActivity.java | 8 | ||||
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 17 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index f776d8ddd..4f02a697f 100755 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -1844,14 +1844,6 @@ public class CameraActivity extends Activity } mLocalImagesObserver.setActivityPaused(false); mLocalVideosObserver.setActivityPaused(false); - - //This is a temporal solution to share LED resource - //as Android doesn’t have any default intent to share the state. - // if the led flash light is open, turn it off - Log.d(TAG, "send the turn off Flashlight broadcast"); - Intent intent = new Intent("org.codeaurora.snapcam.action.CLOSE_FLASHLIGHT"); - intent.putExtra("camera_led", true); - sendBroadcast(intent); } private boolean cameraConnected() { diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 6a684a7fb..390834edf 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1890,10 +1890,11 @@ public class CaptureModule implements CameraModule, PhotoController, private void takePicture() { Log.d(TAG, "takePicture"); mUI.enableShutter(false); - if (mSettingsManager.isZSLInHALEnabled()&& - !isFlashOn(getMainCameraId())&& + if ((mSettingsManager.isZSLInHALEnabled() && + !isFlashOn(getMainCameraId()) && mPreviewCaptureResult.get(CaptureResult.CONTROL_AE_STATE) != - CameraMetadata.CONTROL_AE_STATE_FLASH_REQUIRED) { + CameraMetadata.CONTROL_AE_STATE_FLASH_REQUIRED) || + isActionImageCapture()) { takeZSLPictureInHAL(); } else { if (isBackCamera()) { @@ -1936,6 +1937,10 @@ public class CaptureModule implements CameraModule, PhotoController, } } + private boolean isActionImageCapture() { + return mIntentMode == INTENT_MODE_CAPTURE; + } + private boolean takeZSLPicture(int cameraId) { if(mPostProcessor.isZSLEnabled() && mPostProcessor.takeZSLPicture()) { checkAndPlayShutterSound(getMainCameraId()); @@ -2186,7 +2191,7 @@ public class CaptureModule implements CameraModule, PhotoController, CaptureRequest.Builder captureBuilder = mCameraDevice[id].createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE); - if(mSettingsManager.isZSLInHALEnabled()) { + if(mSettingsManager.isZSLInHALEnabled() || isActionImageCapture() ) { captureBuilder.set(CaptureRequest.CONTROL_ENABLE_ZSL, true); }else{ captureBuilder.set(CaptureRequest.CONTROL_ENABLE_ZSL, false); @@ -3477,6 +3482,10 @@ public class CaptureModule implements CameraModule, PhotoController, } else { mChosenImageFormat = ImageFormat.JPEG; } + // if intent action is ACTION_IMAGE_CAPTURE, use HAL-ZSL to capture + if (isActionImageCapture()) { + mChosenImageFormat = ImageFormat.JPEG; + } setUpCameraOutputs(mChosenImageFormat); } |