catch exceptions thrown at focusing an area

This commit is contained in:
tibbi
2020-09-19 18:57:17 +02:00
parent a40e1611db
commit 42971cc80d

View File

@ -630,8 +630,6 @@ class CameraPreview : ViewGroup, TextureView.SurfaceTextureListener, MyPreview {
try { try {
mCaptureSession!!.stopRepeating() mCaptureSession!!.stopRepeating()
} catch (ignored: Exception) {
}
mPreviewRequestBuilder!!.apply { mPreviewRequestBuilder!!.apply {
set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE) set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE)
@ -652,6 +650,8 @@ class CameraPreview : ViewGroup, TextureView.SurfaceTextureListener, MyPreview {
mCaptureSession!!.capture(build(), captureCallbackHandler, mBackgroundHandler) mCaptureSession!!.capture(build(), captureCallbackHandler, mBackgroundHandler)
set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE) set(CaptureRequest.CONTROL_AF_TRIGGER, CameraMetadata.CONTROL_AF_TRIGGER_IDLE)
} }
} catch (ignored: Exception) {
}
} }
private fun convertAreaToMeteringRectangle(sensorRect: Rect, focusArea: FocusArea): MeteringRectangle { private fun convertAreaToMeteringRectangle(sensorRect: Rect, focusArea: FocusArea): MeteringRectangle {