camera: fix detekt findings
- Commit
016d506c098d2aa31229ba505667f6db0d323235- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-17 15:16 UTC (18 days ago)
- Parents
4796ad5
Fixes every error-severity detekt finding in camera (inventory clusters C3/C4): named constants for magic numbers, extracted functions/composables for long/complex methods, wrapped long lines, removed unused parameters, and narrowed/logged exception handling. No detekt config, baseline or suppression changes; behaviour preserved. Verified: ./check camera and :camera:testDevUnitTest green.
Diff
camera/src/main/java/com/vayunmathur/camera/platform/CameraVideoSession.kt
diff --git a/camera/src/main/java/com/vayunmathur/camera/platform/CameraVideoSession.kt b/camera/src/main/java/com/vayunmathur/camera/platform/CameraVideoSession.ktindex cc27a581cc..255037b450 100644--- a/camera/src/main/java/com/vayunmathur/camera/platform/CameraVideoSession.kt+++ b/camera/src/main/java/com/vayunmathur/camera/platform/CameraVideoSession.kt@@ -255,7 +255,9 @@ internal fun CameraViewModel.buildVideoPreview( } /** Builds the video capture with codec/mirror/dynamic-range + capture options. */-@SuppressLint("RestrictedApi") // Recorder.Builder.setAudioSource(Int) is CameraX's documented public entry point for the mic source; the restriction is on the AudioSpec IntDef constants, not this builder method, and there is no public alternative.+@SuppressLint("RestrictedApi") // Recorder.Builder.setAudioSource(Int) is CameraX's documented+// public entry point for the mic source; the restriction is on the AudioSpec IntDef constants,+// not this builder method, and there is no public alternative. internal fun CameraViewModel.buildVideoCapture( session: VideoSessionPrep, dynamicRange: androidx.camera.core.DynamicRange