From 274e415a705955eec48fb177d2c1e84270ef4328 Mon Sep 17 00:00:00 2001 From: Sai Kumar Sanagavarapu Date: Tue, 8 Oct 2013 19:46:38 +0530 Subject: Camera: Dont reset camera state while capture is in progress. While capture is in progress and if we get autofocus event, currently we reset the camera state to IDLE blindly. This is resulting in app exception because it will trigger another takepicture and lower layers will return error. Change-Id: I947e471cfc1f5cf5055f1d85550d4534b147d7f0 --- src/com/android/camera/PhotoModule.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index f662ed13b..76ee53f0c 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1002,7 +1002,10 @@ public class PhotoModule mAutoFocusTime = System.currentTimeMillis() - mFocusStartTime; Log.v(TAG, "mAutoFocusTime = " + mAutoFocusTime + "ms"); - setCameraState(IDLE); + //don't reset the camera state while capture is in progress + //otherwise, it might result in another takepicture + if(SNAPSHOT_IN_PROGRESS != mCameraState) + setCameraState(IDLE); mFocusManager.onAutoFocus(focused, mUI.isShutterPressed()); } } -- cgit v1.2.3