Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit a7acc09e authored by cketti's avatar cketti Committed by GitHub
Browse files

Merge pull request #3710 from k9mail/notification_cleanup

NotificationChannelUtils cleanup
parents bb87dcc9 c7a7bbfc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ class AuthenticationErrorNotifications {
        String text =  resourceProvider.authenticationErrorBody(account.getDescription());

        NotificationCompat.Builder builder = notificationHelper
                .createNotificationBuilder(account, NotificationChannelUtils.ChannelType.MISCELLANEOUS)
                .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS)
                .setSmallIcon(resourceProvider.getIconWarning())
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true)
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ abstract class BaseNotifications {

    protected NotificationCompat.Builder createAndInitializeNotificationBuilder(Account account) {
        return notificationHelper.createNotificationBuilder(account,
                NotificationChannelUtils.ChannelType.MESSAGES)
                NotificationChannelManager.ChannelType.MESSAGES)
                .setSmallIcon(getNewMailNotificationIcon())
                .setColor(account.getChipColor())
                .setWhen(System.currentTimeMillis())
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class CertificateErrorNotifications {
        String text = resourceProvider.certificateErrorBody();

        NotificationCompat.Builder builder = notificationHelper
                .createNotificationBuilder(account, NotificationChannelUtils.ChannelType.MISCELLANEOUS)
                .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS)
                .setSmallIcon(resourceProvider.getIconWarning())
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true)
+11 −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 { NotificationChannelUtils(get(), get()) }
    bean {
        NotificationChannelManager(
                get(),
                Executors.newSingleThreadExecutor(),
                get<Context>().getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager,
                get()
        )
    }
    bean { CertificateErrorNotifications(get(), get(), get()) }
    bean { AuthenticationErrorNotifications(get(), get(), get()) }
    bean { SyncNotifications(get(), get(), get()) }
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class LockScreenNotification {
        String title = resourceProvider.newMessagesTitle(newMessages);

        return notificationHelper.createNotificationBuilder(account,
                NotificationChannelUtils.ChannelType.MESSAGES)
                NotificationChannelManager.ChannelType.MESSAGES)
                .setSmallIcon(resourceProvider.getIconNewMail())
                .setColor(account.getChipColor())
                .setNumber(unreadCount)
Loading