[Sync] Fix doubled and dead notifications during sync.

This commit is contained in:
Kuba Szczodrzyński 2020-01-20 21:36:53 +01:00
parent 97e0d04842
commit 67d4d0f898
2 changed files with 1 additions and 5 deletions

View File

@ -301,7 +301,7 @@ class ApiService : Service() {
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
d(TAG, "Foreground service onStartCommand")
startForeground(EdziennikNotification.NOTIFICATION_ID, notification.notification)
startForeground(app.notifications.syncId, notification.notification)
return START_NOT_STICKY
}

View File

@ -17,10 +17,6 @@ import kotlin.math.roundToInt
class EdziennikNotification(val app: App) {
companion object {
const val NOTIFICATION_ID = 20191001
}
private val notificationManager by lazy { app.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager }
private val notificationBuilder: NotificationCompat.Builder by lazy {