summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorAndy Huibers <andyhuibers@google.com>2014-08-26 01:34:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-26 01:34:47 +0000
commit4d04e99b46642381b1f80b2a324454ebe741c9f3 (patch)
tree5c8e731ba2bb08131b132d14b9787115c8d32894 /src/com/android/camera
parent46b3c730aa059bf5103922ae0c36c13a12e98223 (diff)
parent62b4c3c0da3abd397b3790820359927784c50bc2 (diff)
downloadandroid_packages_apps_Camera2-4d04e99b46642381b1f80b2a324454ebe741c9f3.tar.gz
android_packages_apps_Camera2-4d04e99b46642381b1f80b2a324454ebe741c9f3.tar.bz2
android_packages_apps_Camera2-4d04e99b46642381b1f80b2a324454ebe741c9f3.zip
Merge "Enable Face rectangles for debugging." into ub-camera-glacier
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/CaptureModule.java6
-rw-r--r--src/com/android/camera/PhotoUI.java9
-rw-r--r--src/com/android/camera/debug/DebugPropertyHelper.java24
-rw-r--r--src/com/android/camera/one/v2/OneCameraImpl.java2
-rw-r--r--src/com/android/camera/ui/FaceView.java2
5 files changed, 25 insertions, 18 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 0b2fb1877..da850adb0 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -150,7 +150,7 @@ public class CaptureModule extends CameraModule
private static final int ON_RESUME_TASKS_DELAY_MSEC = 20;
/** System Properties switch to enable debugging focus UI. */
- private static final boolean FOCUS_DEBUG_UI = DebugPropertyHelper.showFocusDebugUI();
+ private static final boolean CAPTURE_DEBUG_UI = DebugPropertyHelper.showCaptureDebugUI();
private final Object mDimensionLock = new Object();
@@ -660,7 +660,7 @@ public class CaptureModule extends CameraModule
public void onFocusStatusUpdate(final AutoFocusMode mode, final AutoFocusState state) {
Log.v(TAG, "AF status is mode:" + mode + " state:" + state);
- if (FOCUS_DEBUG_UI) {
+ if (CAPTURE_DEBUG_UI) {
// TODO: Add debug circle radius+color UI to FocusOverlay.
// mMainHandler.post(...)
}
@@ -668,7 +668,7 @@ public class CaptureModule extends CameraModule
// If mTapToFocusInProgress, clear UI.
if (mTapToFocusInProgress) {
// Clear UI on return to CONTINUOUS_PICTURE (debug mode).
- if (FOCUS_DEBUG_UI) {
+ if (CAPTURE_DEBUG_UI) {
if (mode == AutoFocusMode.CONTINUOUS_PICTURE) {
mTapToFocusInProgress = false;
mMainHandler.removeCallbacks(mHideAutoFocusTargetRunnable);
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 4d609a9b7..70699a7ed 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -33,6 +33,7 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import com.android.camera.FocusOverlayManager.FocusUI;
+import com.android.camera.debug.DebugPropertyHelper;
import com.android.camera.debug.Log;
import com.android.camera.ui.CountDownView;
import com.android.camera.ui.FaceView;
@@ -65,7 +66,7 @@ public class PhotoUI implements PreviewStatusListener,
private Dialog mDialog = null;
// TODO: Remove face view logic if UX does not bring it back within a month.
- private final FaceView mFaceView = null;
+ private final FaceView mFaceView;
private DecodeImageForReview mDecodeTaskForReview = null;
private float mZoomMax;
@@ -234,6 +235,12 @@ public class PhotoUI implements PreviewStatusListener,
mFocusUI = (FocusUI) mRootView.findViewById(R.id.focus_overlay);
mPreviewOverlay = (PreviewOverlay) mRootView.findViewById(R.id.preview_overlay);
mCountdownView = (CountDownView) mRootView.findViewById(R.id.count_down_view);
+ // Show faces if we are in debug mode.
+ if (DebugPropertyHelper.showCaptureDebugUI()) {
+ mFaceView = (FaceView) mRootView.findViewById(R.id.face_view);
+ } else {
+ mFaceView = null;
+ }
if (mController.isImageCaptureIntent()) {
initIntentReviewImageView();
diff --git a/src/com/android/camera/debug/DebugPropertyHelper.java b/src/com/android/camera/debug/DebugPropertyHelper.java
index 122738f21..0500f5e1c 100644
--- a/src/com/android/camera/debug/DebugPropertyHelper.java
+++ b/src/com/android/camera/debug/DebugPropertyHelper.java
@@ -29,10 +29,14 @@ public class DebugPropertyHelper {
/** Switch between PhotoModule and the new CaptureModule. */
private static final String PROP_ENABLE_CAPTURE_MODULE = PREFIX + ".newcapture";
- /** Enable additional focus logging. */
- private static final String PROP_FOCUS_DEBUG_LOG = PREFIX + ".frame_log";
- /** Enable additional debug UI to show AE, AF, Face detection states */
- private static final String PROP_3A_DEBUG_UI = PREFIX + ".debug_ui";
+ /** Enable frame-by-frame focus logging. */
+ private static final String PROP_FRAME_LOG = PREFIX + ".frame_log";
+ /**
+ * Enable additional capture debug UI.
+ * For API1/Photomodule: show faces.
+ * For API2/Capturemodule: show faces, AF state, AE/AF precise regions.
+ */
+ private static final String PROP_CAPTURE_DEBUG_UI = PREFIX + ".debug_ui";
/** Write data about each capture request to disk. */
private static final String PROP_WRITE_CAPTURE_DATA = PREFIX + ".capture_write";
@@ -44,16 +48,12 @@ public class DebugPropertyHelper {
return ALL_3A_DEBUG_ON || isPropertyOn(PROP_ENABLE_CAPTURE_MODULE);
}
- public static boolean showFocusDebugLog() {
- return ALL_3A_DEBUG_ON || isPropertyOn(PROP_FOCUS_DEBUG_LOG);
+ public static boolean showFrameDebugLog() {
+ return ALL_3A_DEBUG_ON || isPropertyOn(PROP_FRAME_LOG);
}
- public static boolean showFocusDebugUI() {
- return ALL_3A_DEBUG_ON || isPropertyOn(PROP_3A_DEBUG_UI);
- }
-
- public static boolean showFaceDebugUI() {
- return ALL_3A_DEBUG_ON || isPropertyOn(PROP_3A_DEBUG_UI);
+ public static boolean showCaptureDebugUI() {
+ return ALL_3A_DEBUG_ON || isPropertyOn(PROP_CAPTURE_DEBUG_UI);
}
public static boolean writeCaptureData() {
diff --git a/src/com/android/camera/one/v2/OneCameraImpl.java b/src/com/android/camera/one/v2/OneCameraImpl.java
index b677275ad..76e3e2997 100644
--- a/src/com/android/camera/one/v2/OneCameraImpl.java
+++ b/src/com/android/camera/one/v2/OneCameraImpl.java
@@ -85,7 +85,7 @@ public class OneCameraImpl extends AbstractOneCamera {
/** If true, will write data about each capture request to disk. */
private static final boolean DEBUG_WRITE_CAPTURE_DATA = DebugPropertyHelper.writeCaptureData();
/** If true, will log per-frame AF info. */
- private static final boolean DEBUG_FOCUS_LOG = DebugPropertyHelper.showFocusDebugLog();
+ private static final boolean DEBUG_FOCUS_LOG = DebugPropertyHelper.showFrameDebugLog();
/** Default JPEG encoding quality. */
private static final Byte JPEG_QUALITY = 90;
diff --git a/src/com/android/camera/ui/FaceView.java b/src/com/android/camera/ui/FaceView.java
index 8d5c292ca..144031f2d 100644
--- a/src/com/android/camera/ui/FaceView.java
+++ b/src/com/android/camera/ui/FaceView.java
@@ -212,7 +212,7 @@ public class FaceView extends View
}
mPaint.setColor(mColor);
mRect.offset(mPreviewArea.left, mPreviewArea.top);
- canvas.drawOval(mRect, mPaint);
+ canvas.drawRect(mRect, mPaint);
}
canvas.restore();
}