

























@@ -111,7 +111,7 @@ class CameraCaptureManager(private val context: Context) {
111111 provider.unbindAll()
112112 provider.bindToLifecycle(owner, selector, capture)
113113114-val (bytes, orientation) = capture.takeJpegWithExif(context.mainExecutor())
114+val (bytes, orientation) = capture.takeJpegWithExif(context.mainExecutor(), context.cacheDir)
115115val decoded = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
116116?: throw IllegalStateException("UNAVAILABLE: failed to decode captured image")
117117val rotated = rotateBitmapByExif(decoded, orientation)
@@ -214,7 +214,7 @@ class CameraCaptureManager(private val context: Context) {
214214 android.util.Log.w("CameraCaptureManager", "clip: warming up camera 1.5s...")
215215 kotlinx.coroutines.delay(1_500)
216216217-val file = File.createTempFile("openclaw-clip-", ".mp4")
217+val file = File.createTempFile("openclaw-clip-", ".mp4", context.cacheDir)
218218val outputOptions = FileOutputOptions.Builder(file).build()
219219220220val finalized = kotlinx.coroutines.CompletableDeferred<VideoRecordEvent.Finalize>()
@@ -392,9 +392,9 @@ private suspend fun Context.cameraProvider(): ProcessCameraProvider =
392392 }
393393394394/** Returns (jpegBytes, exifOrientation) so caller can rotate the decoded bitmap. */
395-private suspend fun ImageCapture.takeJpegWithExif(executor: Executor): Pair<ByteArray, Int> =
395+private suspend fun ImageCapture.takeJpegWithExif(executor: Executor, tempDir: File): Pair<ByteArray, Int> =
396396 suspendCancellableCoroutine { cont ->
397-val file = File.createTempFile("openclaw-snap-", ".jpg")
397+val file = File.createTempFile("openclaw-snap-", ".jpg", tempDir)
398398val options = ImageCapture.OutputFileOptions.Builder(file).build()
399399 takePicture(
400400 options,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。