summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/FocusOverlayManager.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2013-07-11 13:48:15 -0700
committerAlan Newberger <alann@google.com>2013-12-03 10:13:03 -0800
commitb05794393444ebd13bd24c2ecfb3fbd9963f688e (patch)
tree81b8e79af9aad3c65129690455d1fbe1e283813e /src/com/android/camera/FocusOverlayManager.java
parentd3253f20d9fc971f7cb6bdef6cd6f96b21f7dd63 (diff)
downloadandroid_packages_apps_Camera2-b05794393444ebd13bd24c2ecfb3fbd9963f688e.tar.gz
android_packages_apps_Camera2-b05794393444ebd13bd24c2ecfb3fbd9963f688e.tar.bz2
android_packages_apps_Camera2-b05794393444ebd13bd24c2ecfb3fbd9963f688e.zip
Revert fixed focus area in CAF mode
Bug: 9306098 This doesn't set the faces as focus/exp areas yet, but resets the focus area to null in CAF mode to let the HAL decide focus/exp area. Cherrypick of Bryce CL into Denali. Change-Id: I38e31937f64ecdb23d6c79f96040c46652d1d7d0 Conflicts: src/com/android/camera/FocusOverlayManager.java
Diffstat (limited to 'src/com/android/camera/FocusOverlayManager.java')
-rw-r--r--src/com/android/camera/FocusOverlayManager.java22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index 24d24ec97..2410f6c8b 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -91,7 +91,6 @@ public class FocusOverlayManager {
private Handler mHandler;
Listener mListener;
private boolean mPreviousMoving;
- private boolean mFocusDefault;
private FocusUI mUI;
private final Rect mPreviewRect = new Rect(0, 0, 0, 0);
@@ -144,7 +143,6 @@ public class FocusOverlayManager {
setParameters(parameters);
mListener = listener;
setMirror(mirror);
- mFocusDefault = true;
mUI = ui;
}
@@ -294,7 +292,7 @@ public class FocusOverlayManager {
updateFocusUI();
// If this is triggered by touch focus, cancel focus after a
// while.
- if (!mFocusDefault) {
+ if (mFocusArea != null) {
mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS, RESET_TOUCH_FOCUS_DELAY);
}
if (shutterButtonPressed) {
@@ -365,12 +363,12 @@ public class FocusOverlayManager {
UsageStatistics.ACTION_TOUCH_FOCUS, x + "," + y);
// Let users be able to cancel previous touch focus.
- if ((!mFocusDefault) && (mState == STATE_FOCUSING ||
+ if ((mFocusArea != null) && (mState == STATE_FOCUSING ||
mState == STATE_SUCCESS || mState == STATE_FAIL)) {
cancelAutoFocus();
}
if (mPreviewRect.width() == 0 || mPreviewRect.height() == 0) return;
- mFocusDefault = false;
+ // Initialize variables.
// Initialize mFocusArea.
if (mFocusAreaSupported) {
initializeFocusAreas(x, y);
@@ -449,7 +447,7 @@ public class FocusOverlayManager {
if (mParameters == null) return Parameters.FOCUS_MODE_AUTO;
List<String> supportedFocusModes = mParameters.getSupportedFocusModes();
- if (mFocusAreaSupported && !mFocusDefault) {
+ if (mFocusAreaSupported && mFocusArea != null) {
// Always use autofocus in tap-to-focus.
mFocusMode = Parameters.FOCUS_MODE_AUTO;
} else {
@@ -493,7 +491,7 @@ public class FocusOverlayManager {
// Show only focus indicator or face indicator.
if (mState == STATE_IDLE) {
- if (mFocusDefault) {
+ if (mFocusArea == null) {
mUI.clearFocus();
} else {
// Users touch on the preview and the indicator represents the
@@ -521,14 +519,8 @@ public class FocusOverlayManager {
// Put focus indicator to the center. clear reset position
mUI.clearFocus();
// Initialize mFocusArea.
- if (mFocusAreaSupported) {
- initializeFocusAreas(mPreviewRect.centerX(), mPreviewRect.centerY());
- }
- // Reset metering area when no specific region is selected.
- if (mMeteringAreaSupported) {
- resetMeteringAreas();
- }
- mFocusDefault = true;
+ mFocusArea = null;
+ mMeteringArea = null;
}
private void calculateTapArea(int x, int y, float areaMultiple, Rect rect) {