Loading app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt +10 −1 Original line number Diff line number Diff line package com.fsck.k9.notification import android.app.NotificationManager import android.content.Context import android.support.v4.app.NotificationManagerCompat import org.koin.dsl.module.applicationContext import java.util.concurrent.Executors val coreNotificationModule = applicationContext { bean { NotificationController(get(), get(), get(), get(), get()) } bean { NotificationManagerCompat.from(get()) } bean { NotificationHelper(get(), get(), get()) } bean { NotificationChannelManager(get(), get()) } bean { NotificationChannelManager( get(), Executors.newSingleThreadExecutor(), get<Context>().getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager ) } bean { CertificateErrorNotifications(get(), get(), get()) } bean { AuthenticationErrorNotifications(get(), get(), get()) } bean { SyncNotifications(get(), get(), get()) } Loading app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt +7 −6 Original line number Diff line number Diff line Loading @@ -4,14 +4,17 @@ package com.fsck.k9.notification import android.app.NotificationChannel import android.app.NotificationChannelGroup import android.app.NotificationManager import android.content.Context import android.os.Build import android.support.annotation.RequiresApi import com.fsck.k9.Account import com.fsck.k9.Preferences import java.util.concurrent.Executors import java.util.concurrent.Executor class NotificationChannelManager(private val context: Context, private val preferences: Preferences) { class NotificationChannelManager( private val preferences: Preferences, private val backgroundExecutor: Executor, private val notificationManager: NotificationManager ) { enum class ChannelType { MESSAGES, MISCELLANEOUS Loading @@ -22,9 +25,7 @@ class NotificationChannelManager(private val context: Context, private val prefe return } Executors.newSingleThreadExecutor().execute { val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager backgroundExecutor.execute { val accounts = preferences.accounts removeChannelsForNonExistingOrChangedAccounts(notificationManager, accounts) Loading Loading
app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt +10 −1 Original line number Diff line number Diff line package com.fsck.k9.notification import android.app.NotificationManager import android.content.Context import android.support.v4.app.NotificationManagerCompat import org.koin.dsl.module.applicationContext import java.util.concurrent.Executors val coreNotificationModule = applicationContext { bean { NotificationController(get(), get(), get(), get(), get()) } bean { NotificationManagerCompat.from(get()) } bean { NotificationHelper(get(), get(), get()) } bean { NotificationChannelManager(get(), get()) } bean { NotificationChannelManager( get(), Executors.newSingleThreadExecutor(), get<Context>().getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager ) } bean { CertificateErrorNotifications(get(), get(), get()) } bean { AuthenticationErrorNotifications(get(), get(), get()) } bean { SyncNotifications(get(), get(), get()) } Loading
app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt +7 −6 Original line number Diff line number Diff line Loading @@ -4,14 +4,17 @@ package com.fsck.k9.notification import android.app.NotificationChannel import android.app.NotificationChannelGroup import android.app.NotificationManager import android.content.Context import android.os.Build import android.support.annotation.RequiresApi import com.fsck.k9.Account import com.fsck.k9.Preferences import java.util.concurrent.Executors import java.util.concurrent.Executor class NotificationChannelManager(private val context: Context, private val preferences: Preferences) { class NotificationChannelManager( private val preferences: Preferences, private val backgroundExecutor: Executor, private val notificationManager: NotificationManager ) { enum class ChannelType { MESSAGES, MISCELLANEOUS Loading @@ -22,9 +25,7 @@ class NotificationChannelManager(private val context: Context, private val prefe return } Executors.newSingleThreadExecutor().execute { val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager backgroundExecutor.execute { val accounts = preferences.accounts removeChannelsForNonExistingOrChangedAccounts(notificationManager, accounts) Loading