diff options
author | Santhosh Kumar Thimmanna Bhattar <sthim@codeaurora.org> | 2014-01-13 12:22:44 +0530 |
---|---|---|
committer | Santhosh Kumar Thimmanna Bhattar <sthim@codeaurora.org> | 2014-01-13 18:01:45 +0530 |
commit | cc2543804f11d6cc85b1b54f325b317d082237b5 (patch) | |
tree | 148e010d70d0126c46512d18453f2ce474be0dd0 | |
parent | 4fa5b46ba5ba7872a6815d869ab1d4c72a588dc9 (diff) | |
download | android_packages_apps_Snap-cc2543804f11d6cc85b1b54f325b317d082237b5.tar.gz android_packages_apps_Snap-cc2543804f11d6cc85b1b54f325b317d082237b5.tar.bz2 android_packages_apps_Snap-cc2543804f11d6cc85b1b54f325b317d082237b5.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.
( cherrypicked from commit 1bed537bb0848b6a1f64f9eb245b1c256999ebad )
Change-Id: Ia595dbad246759870371b749c0aa2def221560c5
CRs-Fixed: 550417
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 26cdcffdb..d0035b623 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1163,7 +1163,16 @@ public class PhotoModule mAutoFocusTime = System.currentTimeMillis() - mFocusStartTime; Log.v(TAG, "mAutoFocusTime = " + mAutoFocusTime + "ms"); - if (mCameraState != PhotoController.LONGSHOT) setCameraState(IDLE); + //don't reset the camera state while capture is in progress + //otherwise, it might result in another takepicture + switch (mCameraState) { + case PhotoController.LONGSHOT: + case SNAPSHOT_IN_PROGRESS: + break; + default: + setCameraState(IDLE); + break; + } mFocusManager.onAutoFocus(focused, mUI.isShutterPressed()); } } |