Show notifications from workers (#3760)
Fix a crash where workers, in some conditions, should show a notification. These are sent to a dedicated channel with no importance. Convert NotificationWorker to a CoroutineWorker and remove its use of `runBlocking`. Fixes #3754
This commit is contained in:
parent
7fe4c9f317
commit
1f7a5f626d
7 changed files with 158 additions and 84 deletions
|
|
@ -23,6 +23,7 @@ import androidx.work.ExistingPeriodicWorkPolicy
|
|||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
import androidx.work.WorkManager
|
||||
import autodispose2.AutoDisposePlugins
|
||||
import com.keylesspalace.tusky.components.notifications.NotificationHelper
|
||||
import com.keylesspalace.tusky.di.AppInjector
|
||||
import com.keylesspalace.tusky.settings.PrefKeys
|
||||
import com.keylesspalace.tusky.settings.SCHEMA_VERSION
|
||||
|
|
@ -95,6 +96,8 @@ class TuskyApplication : Application(), HasAndroidInjector {
|
|||
Log.w("RxJava", "undeliverable exception", it)
|
||||
}
|
||||
|
||||
NotificationHelper.createWorkerNotificationChannel(this)
|
||||
|
||||
WorkManager.initialize(
|
||||
this,
|
||||
androidx.work.Configuration.Builder()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue