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

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

Merge pull request #3699 from ojiofong/oji-notification-channel-from-ByteHamster

Add support for notification channels
parents 1e715d17 dbd1c254
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ class AuthenticationErrorNotifications {
        String title = resourceProvider.authenticationErrorTitle();
        String text =  resourceProvider.authenticationErrorBody(account.getDescription());

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

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

        NotificationCompat.Builder builder = notificationHelper.createNotificationBuilder()
        NotificationCompat.Builder builder = notificationHelper
                .createNotificationBuilder(account, NotificationChannelUtils.ChannelType.MISCELLANEOUS)
                .setSmallIcon(resourceProvider.getIconWarning())
                .setWhen(System.currentTimeMillis())
                .setAutoCancel(true)
+2 −1
Original line number Diff line number Diff line
@@ -6,7 +6,8 @@ import org.koin.dsl.module.applicationContext
val coreNotificationModule = applicationContext {
    bean { NotificationController(get(), get(), get(), get(), get()) }
    bean { NotificationManagerCompat.from(get()) }
    bean { NotificationHelper(get(), get()) }
    bean { NotificationHelper(get(), get(), get()) }
    bean { NotificationChannelUtils(get(), get()) }
    bean { CertificateErrorNotifications(get(), get(), get()) }
    bean { AuthenticationErrorNotifications(get(), get(), get()) }
    bean { SyncNotifications(get(), get(), get()) }
+2 −1
Original line number Diff line number Diff line
@@ -88,7 +88,8 @@ class LockScreenNotification {
        int unreadCount = notificationData.getUnreadMessageCount();
        String title = resourceProvider.newMessagesTitle(newMessages);

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