fix: Set isRunning to true

This commit is contained in:
Marc Rousavy 2023-10-25 13:38:12 +02:00
parent ca6af86630
commit f4617a3918
No known key found for this signature in database
GPG Key ID: 83BEF0F19E8F5321

View File

@ -228,6 +228,7 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
cameraDevice = cameraManager.openCamera(cameraId, { device, error ->
if (this.cameraDevice == device) {
Log.e(TAG, "Camera Device $device has been disconnected!", error)
isRunning = false
callback.onError(error)
} else {
// a previous device has been disconnected, but we already have a new one.
@ -441,6 +442,7 @@ class CameraSession(private val context: Context, private val cameraManager: Cam
// Start repeating request if the Camera is active
val request = captureRequest.build()
captureSession.setRepeatingRequest(request, null, null)
isRunning = true
}
suspend fun takePhoto(