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

Fix Exception for calling stop in onPictureTaken Callback #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -655,6 +655,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