summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2017-03-11 09:56:19 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-03-11 09:56:19 -0800
commite63f5e4465c5281d75ce15652a9b31c32168d001 (patch)
tree4de79d832ba0679d6edf8e0faba01fa27ef71fda /src
parenta68765fb88ee78d86490f8987f3f46ff4bb4a266 (diff)
parent3e03c54f44390e76111b0af9c295925b8dff9537 (diff)
downloadandroid_packages_apps_Snap-e63f5e4465c5281d75ce15652a9b31c32168d001.tar.gz
android_packages_apps_Snap-e63f5e4465c5281d75ce15652a9b31c32168d001.tar.bz2
android_packages_apps_Snap-e63f5e4465c5281d75ce15652a9b31c32168d001.zip
Merge "SnapdragonCamera: Fix cancelTouchFocus only once" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CaptureModule.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 7c3e9b418..88037b829 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -194,6 +194,10 @@ public class CaptureModule implements CameraModule, PhotoController,
private static final int SCREEN_DELAY = 2 * 60 * 1000;
+ public static final boolean DEBUG =
+ (PersistUtil.getCamera2Debug() == PersistUtil.CAMERA2_DEBUG_DUMP_LOG) ||
+ (PersistUtil.getCamera2Debug() == PersistUtil.CAMERA2_DEBUG_DUMP_ALL);
+
MeteringRectangle[][] mAFRegions = new MeteringRectangle[MAX_NUM_CAM][];
MeteringRectangle[][] mAERegions = new MeteringRectangle[MAX_NUM_CAM][];
CaptureRequest.Key<Byte> BayerMonoLinkEnableKey =
@@ -1113,7 +1117,9 @@ public class CaptureModule implements CameraModule, PhotoController,
if (!checkSessionAndBuilder(mCaptureSession[id], mPreviewRequestBuilder[id])) {
return;
}
- Log.d(TAG, "setAFModeToPreview " + afMode);
+ if (DEBUG) {
+ Log.d(TAG, "setAFModeToPreview " + afMode);
+ }
mPreviewRequestBuilder[id].set(CaptureRequest.CONTROL_AF_MODE, afMode);
applyAFRegions(mPreviewRequestBuilder[id], id);
applyAERegions(mPreviewRequestBuilder[id], id);
@@ -1127,7 +1133,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public void setFlashModeToPreview(int id, boolean isFlashOn) {
- Log.d(TAG, "setFlashModeToPreview " + isFlashOn);
+ if (DEBUG) {
+ Log.d(TAG, "setFlashModeToPreview " + isFlashOn);
+ }
if (!checkSessionAndBuilder(mCaptureSession[id], mPreviewRequestBuilder[id])) {
return;
}
@@ -1356,7 +1364,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void autoFocusTrigger(int id) {
- Log.d(TAG, "autoFocusTrigger " + id);
+ if (DEBUG) {
+ Log.d(TAG, "autoFocusTrigger " + id);
+ }
if (null == mActivity || null == mCameraDevice[id]
|| !checkSessionAndBuilder(mCaptureSession[id], mPreviewRequestBuilder[id])) {
warningToast("Camera is not ready yet to take a picture.");
@@ -1372,8 +1382,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mState[id] = STATE_WAITING_TOUCH_FOCUS;
mCaptureSession[id].capture(builder.build(), mCaptureCallback, mCameraHandler);
setAFModeToPreview(id, mControlAFMode);
- Message message = mCameraHandler.obtainMessage(
- CANCEL_TOUCH_FOCUS, Integer.valueOf(mCameraId[id]), 0);
+ Message message = mCameraHandler.obtainMessage(CANCEL_TOUCH_FOCUS, mCameraId[id]);
mCameraHandler.sendMessageDelayed(message, CANCEL_TOUCH_FOCUS_DELAY);
} catch (CameraAccessException | IllegalStateException e) {
e.printStackTrace();
@@ -1573,7 +1582,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void captureVideoSnapshot(final int id) {
- Log.d(TAG, "captureStillPicture " + id);
+ Log.d(TAG, "captureVideoSnapshot " + id);
try {
if (null == mActivity || null == mCameraDevice[id] || mCurrentSession == null) {
warningToast("Camera is not ready yet to take a video snapshot.");
@@ -2669,7 +2678,9 @@ public class CaptureModule implements CameraModule, PhotoController,
|| !mAutoExposureRegionSupported || !isTouchToFocusAllowed()) {
return;
}
- Log.d(TAG, "onSingleTapUp " + x + " " + y);
+ if (DEBUG) {
+ Log.d(TAG, "onSingleTapUp " + x + " " + y);
+ }
int[] newXY = {x, y};
if (mUI.isOverControlRegion(newXY)) return;
if (!mUI.isOverSurfaceView(newXY)) return;
@@ -3856,7 +3867,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public Rect cropRegionForZoom(int id) {
- Log.d(TAG, "cropRegionForZoom " + id);
+ if (DEBUG) {
+ Log.d(TAG, "cropRegionForZoom " + id);
+ }
Rect activeRegion = mSettingsManager.getSensorActiveArraySize(id);
Rect cropRegion = new Rect();
@@ -4204,7 +4217,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public void triggerFocusAtPoint(float x, float y, int id) {
- Log.d(TAG, "triggerFocusAtPoint " + x + " " + y + " " + id);
+ if (DEBUG) {
+ Log.d(TAG, "triggerFocusAtPoint " + x + " " + y + " " + id);
+ }
Point p = mUI.getSurfaceViewSize();
int width = p.x;
int height = p.y;
@@ -4218,6 +4233,9 @@ public class CaptureModule implements CameraModule, PhotoController,
if(mPaused)
return;
+ if (DEBUG) {
+ Log.v(TAG, "cancelTouchFocus " + id);
+ }
mState[id] = STATE_PREVIEW;
mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE;
setAFModeToPreview(id, mControlAFMode);