Ensure that same notification builder is used for life of restore service

This commit is contained in:
Moez Bhatti
2018-08-27 20:40:20 -04:00
parent 9825c6c2ee
commit 6d6e7efe4b
@@ -55,6 +55,8 @@ class RestoreBackupService : Service() {
@Inject lateinit var backupRepo: BackupRepository
@Inject lateinit var notificationManager: NotificationManager
private val notification by lazy { notificationManager.getNotificationForBackup() }
override fun onCreate() = AndroidInjection.inject(this)
override fun onBind(intent: Intent?): IBinder? = null
@@ -71,7 +73,6 @@ class RestoreBackupService : Service() {
@SuppressLint("CheckResult")
private fun start(intent: Intent) {
val notification = notificationManager.getNotificationForBackup()
val notificationManager = NotificationManagerCompat.from(this)
startForeground(NOTIFICATION_ID, notification.build())