summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-10-04 21:49:24 -0700
committerIgor Murashkin <iam@google.com>2013-10-04 21:49:24 -0700
commita47d6986cb4aa66e277c61df79a3947bbecd5de8 (patch)
tree40963d7ace56c8e1f4b2528c8df3e8d18653fefe
parent9fcc8956f5a993ae4fda21d1939b1ea6f3d2e4ad (diff)
downloadandroid_frameworks_ex-a47d6986cb4aa66e277c61df79a3947bbecd5de8.tar.gz
android_frameworks_ex-a47d6986cb4aa66e277c61df79a3947bbecd5de8.tar.bz2
android_frameworks_ex-a47d6986cb4aa66e277c61df79a3947bbecd5de8.zip
gcam: Make AF more tolerant to transitioning into same state
Bug: 11014205 Change-Id: I669873307943bfdfbe67e688d1b2de24acd87550
-rw-r--r--camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java b/camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java
index 11d7403..b2a55e4 100644
--- a/camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java
+++ b/camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java
@@ -91,18 +91,21 @@ public class AutoFocusStateMachine {
public synchronized void onCaptureCompleted(CaptureResult result) {
int afState = result.get(CaptureResult.CONTROL_AF_STATE);
+ int afMode = result.get(CaptureResult.CONTROL_AF_MODE);
- if (DEBUG_LOGGING) Log.d(TAG, "onCaptureCompleted - new AF state = " + afState);
+ if (DEBUG_LOGGING) Log.d(TAG, "onCaptureCompleted - new AF mode = " + afMode +
+ " new AF state = " + afState);
- if (mLastAfState == afState) {
+ if (mLastAfState == afState && afMode == mLastAfMode) {
// Same AF state as last time, nothing else needs to be done.
return;
}
- if (VERBOSE_LOGGING) Log.v(TAG, "onCaptureCompleted - new AF state = " + afState);
+ if (VERBOSE_LOGGING) Log.v(TAG, "onCaptureCompleted - new AF mode = " + afMode +
+ " new AF state = " + afState);
mLastAfState = afState;
- mLastAfMode = result.get(CaptureResult.CONTROL_AF_MODE);
+ mLastAfMode = afMode;
switch (afState) {
case CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED: