summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-14 17:08:47 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commit68991103750ceba818c6c55d2e015697c9a406c7 (patch)
treea12817cfcd55f588ce590f4203399396d25cc1db
parent0cabc90c2e117dfe2ab1552b562cc2ef046524ab (diff)
downloadandroid_packages_apps_Snap-68991103750ceba818c6c55d2e015697c9a406c7.zip
android_packages_apps_Snap-68991103750ceba818c6c55d2e015697c9a406c7.tar.gz
android_packages_apps_Snap-68991103750ceba818c6c55d2e015697c9a406c7.tar.bz2
SnapdragonCamera: When mono preview hidden, don't set repeating request
Don't set a repeating request for mono preview when mono preview option is set to off in dual camera mode. CRs-Fixed: 993611 Change-Id: I615483a8ed24689692136e9e2007f19898db5a24
-rw-r--r--src/com/android/camera/CaptureModule.java52
1 files changed, 42 insertions, 10 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 052aea1..80e9d55 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -557,6 +557,11 @@ public class CaptureModule implements CameraModule, PhotoController,
mSettingsManager.getSensorActiveArraySize(getMainCameraId()));
}
+ private boolean canStartMonoPreview() {
+ return getCameraMode() == MONO_MODE ||
+ (getCameraMode() == DUAL_MODE && isMonoPreviewOn());
+ }
+
private boolean isMonoPreviewOn() {
String value = mSettingsManager.getValue(SettingsManager.KEY_MONO_PREVIEW);
if (value == null) return false;
@@ -717,8 +722,15 @@ public class CaptureModule implements CameraModule, PhotoController,
mIsLinked = true;
}
// Finally, we start displaying the camera preview.
- mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
- .build(), mCaptureCallback, mCameraHandler);
+ // for cases where we are in dual mode with mono preview off,
+ // don't set repeating request for mono
+ if(id == MONO_ID && !canStartMonoPreview()) {
+ mCaptureSession[id].capture(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ } else {
+ mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ }
if (isClearSightOn()) {
ClearSightImageProcessor.getInstance().onCaptureSessionConfigured(id == BAYER_ID, cameraCaptureSession);
}
@@ -786,8 +798,13 @@ public class CaptureModule implements CameraModule, PhotoController,
applyAFRegions(mPreviewRequestBuilder[id], id);
applyAERegions(mPreviewRequestBuilder[id], id);
try {
- mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
- .build(), mCaptureCallback, mCameraHandler);
+ if(id == MONO_ID && !canStartMonoPreview()) {
+ mCaptureSession[id].capture(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ } else {
+ mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ }
} catch (CameraAccessException e) {
e.printStackTrace();
}
@@ -1315,8 +1332,13 @@ public class CaptureModule implements CameraModule, PhotoController,
mState[id] = STATE_PREVIEW;
mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE;
setAFModeToPreview(id, mControlAFMode);
- mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id].build(),
- mCaptureCallback, mCameraHandler);
+ if(id == MONO_ID && !canStartMonoPreview()) {
+ mCaptureSession[id].capture(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ } else {
+ mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id].build(),
+ mCaptureCallback, mCameraHandler);
+ }
mTakingPicture[id] = false;
mActivity.runOnUiThread(new Runnable() {
@Override
@@ -2599,8 +2621,13 @@ public class CaptureModule implements CameraModule, PhotoController,
private void applyZoomAndUpdate(int id) {
applyZoom(mPreviewRequestBuilder[id], id);
try {
- mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
- .build(), mCaptureCallback, mCameraHandler);
+ if(id == MONO_ID && !canStartMonoPreview()) {
+ mCaptureSession[id].capture(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ } else {
+ mCaptureSession[id].setRepeatingRequest(mPreviewRequestBuilder[id]
+ .build(), mCaptureCallback, mCameraHandler);
+ }
} catch (CameraAccessException e) {
e.printStackTrace();
}
@@ -2904,8 +2931,13 @@ public class CaptureModule implements CameraModule, PhotoController,
}
if (updatePreviewMono) {
try {
- mCaptureSession[MONO_ID].setRepeatingRequest(mPreviewRequestBuilder[MONO_ID]
- .build(), mCaptureCallback, mCameraHandler);
+ if(canStartMonoPreview()) {
+ mCaptureSession[MONO_ID].setRepeatingRequest(mPreviewRequestBuilder[MONO_ID]
+ .build(), mCaptureCallback, mCameraHandler);
+ } else {
+ mCaptureSession[MONO_ID].capture(mPreviewRequestBuilder[MONO_ID]
+ .build(), mCaptureCallback, mCameraHandler);
+ }
} catch (CameraAccessException e) {
e.printStackTrace();
}