Sync: use foreground service on every android version

This commit is contained in:
ganfra 2019-12-27 17:09:57 +01:00
parent 833a5a37a2
commit 037bf45884

View File

@ -45,7 +45,6 @@ class VectorSyncService : SyncService() {
} }
override fun onStart(isInitialSync: Boolean) { override fun onStart(isInitialSync: Boolean) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val notificationSubtitleRes = if (isInitialSync) { val notificationSubtitleRes = if (isInitialSync) {
R.string.notification_initial_sync R.string.notification_initial_sync
} else { } else {
@ -54,7 +53,6 @@ class VectorSyncService : SyncService() {
val notification = notificationUtils.buildForegroundServiceNotification(notificationSubtitleRes, false) val notification = notificationUtils.buildForegroundServiceNotification(notificationSubtitleRes, false)
startForeground(NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, notification) startForeground(NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, notification)
} }
}
override fun onRescheduleAsked(userId: String, isInitialSync: Boolean, delay: Long) { override fun onRescheduleAsked(userId: String, isInitialSync: Boolean, delay: Long) {
reschedule(userId, delay) reschedule(userId, delay)