fix: Improve code

This commit is contained in:
Myzel394 2023-10-24 15:49:15 +02:00
parent cb43a1b371
commit 16e6fd8fc2
No known key found for this signature in database
GPG Key ID: 50098FCA22080F0F

View File

@ -152,11 +152,10 @@ abstract class RecorderService : Service() {
fun startRecording() { fun startRecording() {
recordingStart = LocalDateTime.now() recordingStart = LocalDateTime.now()
val notification = getNotificationHelper().buildStartingNotification()
ServiceCompat.startForeground( ServiceCompat.startForeground(
this, this,
NotificationHelper.RECORDER_CHANNEL_NOTIFICATION_ID, NotificationHelper.RECORDER_CHANNEL_NOTIFICATION_ID,
notification, getNotificationHelper().buildStartingNotification(),
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
} else { } else {