diff options
author | Michael Kolb <kolby@google.com> | 2013-12-03 10:10:46 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-12-03 10:10:46 -0800 |
commit | 1e5baa473c233f7b4bd1568d5047c20533e4ce59 (patch) | |
tree | f94481d56cb2a3713d296a262f7eed49e8b137b6 | |
parent | a3b928919285fbe31a1201cb0b56336a3909cb4f (diff) | |
parent | 0f7d5488d33988c1ee3636fe3a7d6472bed84f00 (diff) | |
download | android_packages_apps_Snap-1e5baa473c233f7b4bd1568d5047c20533e4ce59.tar.gz android_packages_apps_Snap-1e5baa473c233f7b4bd1568d5047c20533e4ce59.tar.bz2 android_packages_apps_Snap-1e5baa473c233f7b4bd1568d5047c20533e4ce59.zip |
am 0f7d5488: Revert fixed focus area in CAF mode
* commit '0f7d5488d33988c1ee3636fe3a7d6472bed84f00':
Revert fixed focus area in CAF mode
-rw-r--r-- | src/com/android/camera/FocusOverlayManager.java | 22 |
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) { |