diff --git a/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotifications.java b/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotifications.java index 34f24ff05..c7211130c 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotifications.java +++ b/app/core/src/main/java/com/fsck/k9/notification/AuthenticationErrorNotifications.java @@ -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) diff --git a/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.java b/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.java index 76edc1d20..980665aef 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.java +++ b/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.java @@ -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()) diff --git a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.java b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.java index 330d99d4f..40c4784b7 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.java +++ b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.java @@ -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) diff --git a/app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt b/app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt index fc9dd9958..ff9975e1a 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/CoreKoinModule.kt @@ -7,7 +7,7 @@ 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(), get()) } bean { CertificateErrorNotifications(get(), get(), get()) } bean { AuthenticationErrorNotifications(get(), get(), get()) } bean { SyncNotifications(get(), get(), get()) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.java b/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.java index 9543d0db0..30c6ed6b0 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.java +++ b/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.java @@ -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) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelUtils.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt similarity index 97% rename from app/core/src/main/java/com/fsck/k9/notification/NotificationChannelUtils.kt rename to app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt index f707f3852..dca61b70e 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelUtils.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationChannelManager.kt @@ -11,7 +11,7 @@ import com.fsck.k9.Account import com.fsck.k9.Preferences import java.util.concurrent.Executors -class NotificationChannelUtils(private val context: Context, private val preferences: Preferences) { +class NotificationChannelManager(private val context: Context, private val preferences: Preferences) { enum class ChannelType { MESSAGES, MISCELLANEOUS diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt index 266c242c7..d46014bec 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationHelper.kt @@ -11,7 +11,7 @@ import com.fsck.k9.K9 class NotificationHelper( private val context: Context, private val notificationManager: NotificationManagerCompat, - private val channelUtils: NotificationChannelUtils + private val channelUtils: NotificationChannelManager ) { fun configureNotification( builder: NotificationCompat.Builder, @@ -64,7 +64,7 @@ class NotificationHelper( fun createNotificationBuilder( account: Account, - channelType: NotificationChannelUtils.ChannelType + channelType: NotificationChannelManager.ChannelType ): NotificationCompat.Builder { return NotificationCompat.Builder(context, channelUtils.getChannelIdFor(account, channelType)) diff --git a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.java b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.java index fc9089345..c86255a68 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.java +++ b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.java @@ -34,7 +34,7 @@ class SendFailedNotifications { account, notificationId); NotificationCompat.Builder builder = notificationHelper - .createNotificationBuilder(account, NotificationChannelUtils.ChannelType.MISCELLANEOUS) + .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS) .setSmallIcon(resourceProvider.getIconWarning()) .setWhen(System.currentTimeMillis()) .setAutoCancel(true) diff --git a/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.java b/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.java index 98adf56e8..65027fc93 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.java +++ b/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.java @@ -38,7 +38,7 @@ class SyncNotifications { account, outboxFolder, notificationId); NotificationCompat.Builder builder = notificationHelper.createNotificationBuilder(account, - NotificationChannelUtils.ChannelType.MISCELLANEOUS) + NotificationChannelManager.ChannelType.MISCELLANEOUS) .setSmallIcon(resourceProvider.getIconSendingMail()) .setWhen(System.currentTimeMillis()) .setOngoing(true) @@ -77,7 +77,7 @@ class SyncNotifications { account, folderServerId, notificationId); NotificationCompat.Builder builder = notificationHelper.createNotificationBuilder(account, - NotificationChannelUtils.ChannelType.MISCELLANEOUS) + NotificationChannelManager.ChannelType.MISCELLANEOUS) .setSmallIcon(resourceProvider.getIconCheckingMail()) .setWhen(System.currentTimeMillis()) .setOngoing(true) diff --git a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.java index 34fd44709..40062f2c3 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.java @@ -116,7 +116,7 @@ public class AuthenticationErrorNotificationsTest extends RobolectricTest { when(notificationHelper.getContext()).thenReturn(RuntimeEnvironment.application); when(notificationHelper.getNotificationManager()).thenReturn(notificationManager); when(notificationHelper.createNotificationBuilder(any(Account.class), - any(NotificationChannelUtils.ChannelType.class))) + any(NotificationChannelManager.ChannelType.class))) .thenReturn(builder); return notificationHelper; diff --git a/app/core/src/test/java/com/fsck/k9/notification/BaseNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/BaseNotificationsTest.java index f1f23fc92..89bc4e1e2 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/BaseNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/BaseNotificationsTest.java @@ -112,7 +112,7 @@ public class BaseNotificationsTest { private NotificationHelper createFakeNotificationHelper() { Builder builder = MockHelper.mockBuilder(Builder.class); NotificationHelper notificationHelper = mock(NotificationHelper.class); - when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelUtils + when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelManager .ChannelType.class))).thenReturn(builder); when(notificationHelper.getAccountName(any(Account.class))).thenReturn(ACCOUNT_NAME); return notificationHelper; diff --git a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.java index 8347a3e32..582bdda63 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.java @@ -116,7 +116,7 @@ public class CertificateErrorNotificationsTest extends RobolectricTest { when(notificationHelper.getContext()).thenReturn(RuntimeEnvironment.application); when(notificationHelper.getNotificationManager()).thenReturn(notificationManager); when(notificationHelper.createNotificationBuilder(any(Account.class), - any(NotificationChannelUtils.ChannelType.class))) + any(NotificationChannelManager.ChannelType.class))) .thenReturn(builder); return notificationHelper; diff --git a/app/core/src/test/java/com/fsck/k9/notification/DeviceNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/DeviceNotificationsTest.java index 2f5306355..e03985e0a 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/DeviceNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/DeviceNotificationsTest.java @@ -224,7 +224,7 @@ public class DeviceNotificationsTest extends RobolectricTest { NotificationHelper notificationHelper = mock(NotificationHelper.class); when(notificationHelper.getContext()).thenReturn(context); when(notificationHelper.getAccountName(any(Account.class))).thenReturn(ACCOUNT_NAME); - when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelUtils + when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelManager .ChannelType.class))).thenAnswer(new Answer() { private int invocationCount = 0; diff --git a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.java b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.java index 296c8c970..034b3fb98 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.java @@ -168,7 +168,7 @@ public class LockScreenNotificationTest extends RobolectricTest { NotificationHelper notificationHelper = mock(NotificationHelper.class); when(notificationHelper.getContext()).thenReturn(context); when(notificationHelper.getAccountName(any(Account.class))).thenReturn(ACCOUNT_NAME); - when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelUtils + when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelManager .ChannelType.class))).thenReturn(builder); return notificationHelper; diff --git a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.java index 37635f14d..08e0605dc 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.java @@ -92,7 +92,7 @@ public class SendFailedNotificationsTest extends RobolectricTest { when(notificationHelper.getContext()).thenReturn(RuntimeEnvironment.application); when(notificationHelper.getNotificationManager()).thenReturn(notificationManager); when(notificationHelper.createNotificationBuilder(any(Account.class), - any(NotificationChannelUtils.ChannelType.class))) + any(NotificationChannelManager.ChannelType.class))) .thenReturn(builder); return notificationHelper; diff --git a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.java index bbdf834c7..e8c110f0b 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.java @@ -124,7 +124,7 @@ public class SyncNotificationsTest extends RobolectricTest { when(notificationHelper.getContext()).thenReturn(RuntimeEnvironment.application); when(notificationHelper.getNotificationManager()).thenReturn(notificationManager); when(notificationHelper.createNotificationBuilder(any(Account.class), - any(NotificationChannelUtils.ChannelType.class))) + any(NotificationChannelManager.ChannelType.class))) .thenReturn(builder); when(notificationHelper.getAccountName(any(Account.class))).thenReturn(ACCOUNT_NAME); diff --git a/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.java b/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.java index a9e7a59e1..2069b02f3 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.java +++ b/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.java @@ -230,7 +230,7 @@ public class WearNotificationsTest extends RobolectricTest { private NotificationHelper createNotificationHelper(Context context, Builder builder) { NotificationHelper notificationHelper = mock(NotificationHelper.class); - when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelUtils + when(notificationHelper.createNotificationBuilder(any(Account.class), any(NotificationChannelManager .ChannelType.class))).thenReturn(builder); when(notificationHelper.getAccountName(account)).thenReturn(ACCOUNT_NAME); when(notificationHelper.getContext()).thenReturn(context); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java index 8aafc2ae0..37ca3b70c 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java @@ -50,7 +50,7 @@ import com.fsck.k9.helper.ParcelableUtil; import com.fsck.k9.mailstore.Folder; import com.fsck.k9.mailstore.SearchStatusManager; import com.fsck.k9.mailstore.StorageManager; -import com.fsck.k9.notification.NotificationChannelUtils; +import com.fsck.k9.notification.NotificationChannelManager; import com.fsck.k9.preferences.StorageEditor; import com.fsck.k9.search.LocalSearch; import com.fsck.k9.search.SearchAccount; @@ -165,7 +165,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen protected final SearchStatusManager searchStatusManager = DI.get(SearchStatusManager.class); private StorageManager.StorageListener mStorageListener = new StorageListenerImplementation(); private final Preferences preferences = DI.get(Preferences.class); - private final NotificationChannelUtils channelUtils = DI.get(NotificationChannelUtils.class); + private final NotificationChannelManager channelUtils = DI.get(NotificationChannelManager.class); private ActionBar actionBar; private ActionBarDrawerToggle drawerToggle;