forked from github/szkolny
[Sync] Fix doubled and dead notifications during sync.
This commit is contained in:
parent
97e0d04842
commit
67d4d0f898
@ -301,7 +301,7 @@ class ApiService : Service() {
|
|||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
d(TAG, "Foreground service onStartCommand")
|
d(TAG, "Foreground service onStartCommand")
|
||||||
startForeground(EdziennikNotification.NOTIFICATION_ID, notification.notification)
|
startForeground(app.notifications.syncId, notification.notification)
|
||||||
return START_NOT_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,10 +17,6 @@ import kotlin.math.roundToInt
|
|||||||
|
|
||||||
|
|
||||||
class EdziennikNotification(val app: App) {
|
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 notificationManager by lazy { app.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager }
|
||||||
|
|
||||||
private val notificationBuilder: NotificationCompat.Builder by lazy {
|
private val notificationBuilder: NotificationCompat.Builder by lazy {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user