am 15a49e43: am a47d6986: gcam: Make AF more tolerant to transitioning into same state
* commit '15a49e431b3b55a428065fbf0c74d53673508c24':
gcam: Make AF more tolerant to transitioning into same state
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 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: