From 5261864abaceea3f981d8d9bfec6e643f5c06658 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 5 Jan 2020 22:19:30 -0800 Subject: [PATCH] Fixes to the extension updates notifcation --- .../kanade/tachiyomi/extension/ExtensionUpdateJob.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt index 7225330b23..2838d2584a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt @@ -1,6 +1,7 @@ package eu.kanade.tachiyomi.extension +import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import com.evernote.android.job.Job @@ -11,7 +12,6 @@ import eu.kanade.tachiyomi.data.notification.NotificationReceiver import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.util.notification import rx.Observable -import rx.Subscription import rx.schedulers.Schedulers import timber.log.Timber import uy.kohesive.injekt.Injekt @@ -20,16 +20,12 @@ import java.util.concurrent.TimeUnit class ExtensionUpdateJob : Job() { - var subscription:Subscription? = null - override fun onRunJob(params: Params): Result { val extensionManager: ExtensionManager = Injekt.get() extensionManager.findAvailableExtensions() - subscription?.unsubscribe() - // Update favorite manga. Destroy service when completed or in case of an error. - subscription = Observable.defer { + Observable.defer { extensionManager.getInstalledExtensionsObservable().map { list -> val pendingUpdates = list.filter { it.hasUpdate } if (pendingUpdates.isNotEmpty()) { @@ -48,6 +44,7 @@ class ExtensionUpdateJob : Job() { ) } else names.joinToString(", ") setContentText(extNames) + setStyle(NotificationCompat.BigTextStyle().bigText(extNames)) setSmallIcon(R.drawable.ic_extension_update) color = ContextCompat.getColor(context, R.color.colorAccentLight) setContentIntent( @@ -59,7 +56,6 @@ class ExtensionUpdateJob : Job() { }) } } - subscription?.unsubscribe() Result.SUCCESS } }.subscribeOn(Schedulers.io())