From bc5227ba4f9770b384078d8614b962ca041a69d9 Mon Sep 17 00:00:00 2001 From: Bastian Kohler Date: Mon, 19 Jun 2023 14:37:49 +0200 Subject: [PATCH] Refactor of DetectorService --- .../Detection/DetectorService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectorService.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectorService.java index 8f1bb82..49b46c0 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectorService.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectorService.java @@ -16,6 +16,8 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.lifecycle.LifecycleService; +import java.io.File; + @ExperimentalGetImage public class DetectorService extends LifecycleService { @@ -117,6 +119,10 @@ public class DetectorService extends LifecycleService { return videoDetector.isRecording(); return false; } + public void setVideoRecordingDir(File outputDir) { + if (videoDetector != null) + videoDetector.setOutputDir(outputDir); + } /** Audio Recording */ public void startAudioRecording() { @@ -132,6 +138,12 @@ public class DetectorService extends LifecycleService { return audioRecorder.isRecording(); return false; } + public void setAudioRecordingDir(File outputDir) { + if (audioRecorder != null) + audioRecorder.setOutputDir(outputDir); + } + + /** pass Detection Report to Service Detection Listener and trigger it */