summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/FocusOverlayManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/FocusOverlayManager.java')
-rw-r--r--src/com/android/camera/FocusOverlayManager.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index 51b8b78f5..602c31767 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 boolean mZslEnabled = false; //QCom Parameter to disable focus for ZSL
private boolean mTouchAFRunning = false;
private boolean mIsAFRunning = false;
@@ -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) {
@@ -371,12 +369,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);
@@ -461,7 +459,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 {
@@ -506,7 +504,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
@@ -538,14 +536,11 @@ public class FocusOverlayManager {
// Initialize mMeteringArea.
mMeteringArea = null;
- if (mFocusAreaSupported) {
- initializeFocusAreas(mPreviewRect.centerX(), mPreviewRect.centerY());
- }
// Reset metering area when no specific region is selected.
if (mMeteringAreaSupported) {
resetMeteringAreas();
}
- mFocusDefault = true;
+
if (mTouchAFRunning && mZslEnabled) {
mTouchAFRunning = false;
mListener.setFocusParameters();