summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorxianming wang <mingwax@codeaurora.org>2018-11-05 14:29:37 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-11-14 00:04:44 -0800
commit761322c4147e1c5d6ebe43f583c1bc4a377731ff (patch)
treecb0d8974e2e7d478017adc5b7c1a940e45312aee /src
parent78b730055695188e43819ddf108b63021c9d7d7c (diff)
downloadandroid_packages_apps_Snap-761322c4147e1c5d6ebe43f583c1bc4a377731ff.tar.gz
android_packages_apps_Snap-761322c4147e1c5d6ebe43f583c1bc4a377731ff.tar.bz2
android_packages_apps_Snap-761322c4147e1c5d6ebe43f583c1bc4a377731ff.zip
SnapdragonCamera: Use HAL-ZSL to capture in ACTION_IMAGE_CAPTURE
Use HAL-ZSL to capture in ACTION_IMAGE_CAPTURE. CRs-Fixed: 2344684 Change-Id: I9ebd36130e87bf97ff559295c7a75ae61973e587
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java8
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java17
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 5ec6f5be9..47fb48eb4 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1849,10 +1849,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()) {
@@ -1895,6 +1896,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());
@@ -2143,7 +2148,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);
@@ -3403,6 +3408,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);
}