fix: Only require FOREGROUND_SERVICE_TYPE_CAMERA when no audio requested

This commit is contained in:
Myzel394 2024-01-10 14:49:44 +01:00
parent cfec7147fb
commit dd5344c2a0
No known key found for this signature in database
GPG Key ID: 50098FCA22080F0F

View File

@ -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
},