summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Kumar Sanagavarapu <ssanagav@codeaurora.org>2013-10-08 19:46:38 +0530
committerSteve Kondik <shade@chemlab.org>2013-12-10 23:25:04 -0800
commit274e415a705955eec48fb177d2c1e84270ef4328 (patch)
tree1ec24cfde58453fb39c7ffab1fba2de82fd2a6ea
parentf7a73ff0a9bcda17996d10f1b84acc8cab4cc504 (diff)
downloadandroid_packages_apps_Gallery2-274e415a705955eec48fb177d2c1e84270ef4328.tar.gz
android_packages_apps_Gallery2-274e415a705955eec48fb177d2c1e84270ef4328.tar.bz2
android_packages_apps_Gallery2-274e415a705955eec48fb177d2c1e84270ef4328.zip
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
-rw-r--r--src/com/android/camera/PhotoModule.java5
1 files changed, 4 insertions, 1 deletions
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());
}
}