Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Prev Previous commit
Next Next commit
Add comment
  • Loading branch information
camsim99 committed Jun 3, 2022
commit 0ead150fbea876216039cad2a58b5a48996623b5
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,10 @@ public void close() {
if (cameraDevice != null) {
cameraDevice.close();
cameraDevice = null;

// Closing the CameraDevice without closing the CameraCaptureSession is recommended
// for quickly closing the camera:
// https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession#close()
captureSession = null;
} else {
closeCaptureSession();
Expand Down