Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Fix Exception for calling stop in onPictureTaken Callback
Browse files Browse the repository at this point in the history
Fixes bug #67
  • Loading branch information
bsagal committed Mar 27, 2017
1 parent 6ceaf86 commit 2821c1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ void takePictureInternal() {
public void onPictureTaken(byte[] data, Camera camera) {
isPictureCaptureInProgress.set(false);
mCallback.onPictureTaken(data);
if (!isCameraOpened()) return;
camera.cancelAutoFocus();
camera.startPreview();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ public void onCaptureCompleted(@NonNull CameraCaptureSession session,
* capturing a still picture.
*/
void unlockFocus() {
if (!isCameraOpened()) return;
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AF_TRIGGER,
CaptureRequest.CONTROL_AF_TRIGGER_CANCEL);
try {
Expand Down

0 comments on commit 2821c1d

Please sign in to comment.