diff options
Diffstat (limited to 'camera2/public/src')
-rw-r--r-- | camera2/public/src/com/android/ex/camera2/pos/AutoFocusStateMachine.java | 11 |
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: |