From dd5344c2a0908ef596718c91be72b7595fd0f47f Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:49:44 +0100 Subject: [PATCH] fix: Only require FOREGROUND_SERVICE_TYPE_CAMERA when no audio requested --- .../java/app/myzel394/alibi/services/VideoRecorderService.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/myzel394/alibi/services/VideoRecorderService.kt b/app/src/main/java/app/myzel394/alibi/services/VideoRecorderService.kt index 0dd9cd2..abcadf4 100644 --- a/app/src/main/java/app/myzel394/alibi/services/VideoRecorderService.kt +++ b/app/src/main/java/app/myzel394/alibi/services/VideoRecorderService.kt @@ -111,7 +111,10 @@ class VideoRecorderService : NotificationHelper.RECORDER_CHANNEL_NOTIFICATION_ID, getNotificationHelper().buildStartingNotification(), if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE + if (enableAudio) + ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA or ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE + else + ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA } else { 0 },