summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/FocusOverlayManager.java
diff options
context:
space:
mode:
authorKevin Gabayan <gabayan@google.com>2014-06-13 20:49:48 +0000
committerKevin Gabayan <gabayan@google.com>2014-06-13 20:49:48 +0000
commit516c11a6885f6e524927bd369567f5bbd592f8ef (patch)
tree212207159d5251e858b287608e8e907eda060138 /src/com/android/camera/FocusOverlayManager.java
parentebba3288da5628c9ea7579b63139aa7b7312e137 (diff)
downloadandroid_packages_apps_Camera2-516c11a6885f6e524927bd369567f5bbd592f8ef.tar.gz
android_packages_apps_Camera2-516c11a6885f6e524927bd369567f5bbd592f8ef.tar.bz2
android_packages_apps_Camera2-516c11a6885f6e524927bd369567f5bbd592f8ef.zip
Revert "MotionManager for motion-aware focus unlock in Camera2 Bug: 14222601"
This reverts commit ebba3288da5628c9ea7579b63139aa7b7312e137. Change-Id: Ie82d81aa0440339aba1b762fa78caeb7f7d55312
Diffstat (limited to 'src/com/android/camera/FocusOverlayManager.java')
-rw-r--r--src/com/android/camera/FocusOverlayManager.java20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java
index 291ce68c8..fa7e9653e 100644
--- a/src/com/android/camera/FocusOverlayManager.java
+++ b/src/com/android/camera/FocusOverlayManager.java
@@ -29,7 +29,6 @@ import android.os.Message;
import com.android.camera.cameradevice.CameraCapabilities;
import com.android.camera.cameradevice.CameraCapabilitiesFactory;
-import com.android.camera.app.MotionManager;
import com.android.camera.debug.Log;
import com.android.camera.settings.SettingsManager;
import com.android.camera.ui.PreviewStatusListener;
@@ -60,8 +59,7 @@ import java.util.List;
* (10) The camera has no autofocus and supports metering area. Touch the screen
* to change metering area.
*/
-public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaChangedListener,
- MotionManager.MotionListener {
+public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaChangedListener {
private static final Log.Tag TAG = new Log.Tag("FocusOverlayMgr");
private static final int RESET_TOUCH_FOCUS = 0;
@@ -95,9 +93,9 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
private final Handler mHandler;
Listener mListener;
private boolean mPreviousMoving;
+
private final FocusUI mUI;
private final Rect mPreviewRect = new Rect(0, 0, 0, 0);
- private boolean mFocusLocked;
public interface FocusUI {
public boolean hasFaces();
@@ -149,7 +147,6 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
mListener = listener;
setMirror(mirror);
mUI = ui;
- mFocusLocked = false;
}
public void setParameters(Parameters parameters, CameraCapabilities capabilities) {
@@ -279,7 +276,6 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
// If this is triggered by touch focus, cancel focus after a
// while.
if (mFocusArea != null) {
- mFocusLocked = true;
mHandler.sendEmptyMessageDelayed(RESET_TOUCH_FOCUS, RESET_TOUCH_FOCUS_DELAY);
}
if (shutterButtonPressed) {
@@ -393,20 +389,13 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
onPreviewStopped();
}
- @Override
- public void onMoving() {
- if (mFocusLocked) {
- Log.d(TAG, "onMoving: Early focus unlock.");
- cancelAutoFocus();
- }
- }
-
/**
* Triggers the autofocus and sets the specified state.
*
* @param focusingState The state to use when focus is in progress.
*/
private void autoFocus(int focusingState) {
+ Log.v(TAG, "Start autofocus.");
mListener.autoFocus();
mState = focusingState;
// Pause the face view because the driver will keep sending face
@@ -433,7 +422,7 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
}
private void cancelAutoFocus() {
- Log.i(TAG, "Cancel autofocus.");
+ Log.v(TAG, "Cancel autofocus.");
// Reset the tap area before calling mListener.cancelAutofocus.
// Otherwise, focus mode stays at auto and the tap area passed to the
// driver is not reset.
@@ -441,7 +430,6 @@ public class FocusOverlayManager implements PreviewStatusListener.PreviewAreaCha
mListener.cancelAutoFocus();
mUI.resumeFaceDetection();
mState = STATE_IDLE;
- mFocusLocked = false;
updateFocusUI();
mHandler.removeMessages(RESET_TOUCH_FOCUS);
}