diff --git a/app/src/main/java/org/koitharu/kotatsu/download/ui/service/ForegroundNotificationSwitcher.kt b/app/src/main/java/org/koitharu/kotatsu/download/ui/service/ForegroundNotificationSwitcher.kt index c7d0b0191..679405295 100644 --- a/app/src/main/java/org/koitharu/kotatsu/download/ui/service/ForegroundNotificationSwitcher.kt +++ b/app/src/main/java/org/koitharu/kotatsu/download/ui/service/ForegroundNotificationSwitcher.kt @@ -24,7 +24,7 @@ class ForegroundNotificationSwitcher( @Synchronized fun notify(startId: Int, notification: Notification) { if (notifications.isEmpty()) { - StartForegroundRunnable(startId, notification) + service.startForeground(startId, notification) } else { notificationManager.notify(startId, notification) } @@ -46,16 +46,6 @@ class ForegroundNotificationSwitcher( handler.postDelayed(NotifyRunnable(startId, notification), DEFAULT_DELAY) } - private inner class StartForegroundRunnable( - private val startId: Int, - private val notification: Notification, - ) : Runnable { - - override fun run() { - service.startForeground(startId, notification) - } - } - private inner class NotifyRunnable( private val startId: Int, private val notification: Notification?,