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 09:45:02 -0800
commit0f7d5488d33988c1ee3636fe3a7d6472bed84f00 (patch)
treef94481d56cb2a3713d296a262f7eed49e8b137b6 /src/com/android/camera/FocusOverlayManager.java
parent0d5505dd1a3bf297677161c4c6608c783d7a2b68 (diff)
downloadandroid_packages_apps_Snap-0f7d5488d33988c1ee3636fe3a7d6472bed84f00.tar.gz
android_packages_apps_Snap-0f7d5488d33988c1ee3636fe3a7d6472bed84f00.tar.bz2
android_packages_apps_Snap-0f7d5488d33988c1ee3636fe3a7d6472bed84f00.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 Carlsbad. 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 f382a2ad6..797316258 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -89,7 +89,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);
@@ -141,7 +140,6 @@ public class FocusOverlayManager {
setParameters(parameters);
mListener = listener;
setMirror(mirror);
- mFocusDefault = true;
mUI = ui;
}
@@ -291,7 +289,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) {
@@ -362,12 +360,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);
@@ -447,7 +445,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 {
@@ -492,7 +490,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
@@ -520,14 +518,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) {