From 3e427589d8410eaaef20b4f245363c9d83d06158 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 16 Dec 2021 14:54:06 +0530 Subject: [PATCH 1/7] fix pipeline bug --- app/k9mail/src/main/res/values/themes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/k9mail/src/main/res/values/themes.xml b/app/k9mail/src/main/res/values/themes.xml index 3d9a2729b7..c8fbe91365 100644 --- a/app/k9mail/src/main/res/values/themes.xml +++ b/app/k9mail/src/main/res/values/themes.xml @@ -50,7 +50,7 @@ @lineageos.platform:drawable/ic_star_filled @lineageos.platform:drawable/ic_star @drawable/ic_opened_envelope - @lineageos.platform:@drawable/ic_mark_new + @lineageos.platform:drawable/ic_mark_new @drawable/ic_magnify_cloud @lineageos.platform:drawable/ic_add @drawable/ic_arrow_up_down -- GitLab From d64d07587f450f550c7559c7896de95e92b8ac03 Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 16 Dec 2021 16:25:18 +0530 Subject: [PATCH 2/7] fix pipeline bug --- app/k9mail/src/main/res/values/themes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/k9mail/src/main/res/values/themes.xml b/app/k9mail/src/main/res/values/themes.xml index c8fbe91365..becc4383ee 100644 --- a/app/k9mail/src/main/res/values/themes.xml +++ b/app/k9mail/src/main/res/values/themes.xml @@ -50,7 +50,7 @@ @lineageos.platform:drawable/ic_star_filled @lineageos.platform:drawable/ic_star @drawable/ic_opened_envelope - @lineageos.platform:drawable/ic_mark_new + @drawable/ic_mark_new @drawable/ic_magnify_cloud @lineageos.platform:drawable/ic_add @drawable/ic_arrow_up_down @@ -169,7 +169,7 @@ @lineageos.platform:drawable/ic_star_filled @lineageos.platform:drawable/ic_star @drawable/ic_opened_envelope - @lineageos.platform:drawable/ic_mark_new + @drawable/ic_mark_new @drawable/ic_magnify_cloud @lineageos.platform:drawable/ic_add @drawable/ic_arrow_up_down -- GitLab From b56310b53f74e6a686a7dc5ee08be1b97d365add Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Thu, 16 Dec 2021 20:59:53 +0530 Subject: [PATCH 3/7] ./gradlew ktlintFormat --- app/core/src/main/java/com/fsck/k9/K9.kt | 5 ++--- app/core/src/main/java/com/fsck/k9/Preferences.kt | 2 +- .../java/com/fsck/k9/controller/MessageCountsProvider.kt | 2 +- .../main/java/com/fsck/k9/controller/NotificationState.kt | 2 +- .../com/fsck/k9/controller/push/AccountPushController.kt | 5 ++--- .../k9/controller/push/AccountPushControllerFactory.kt | 2 +- .../AutoExpandFolderBackendFoldersRefreshListener.kt | 2 +- .../main/java/com/fsck/k9/mailstore/FolderRepository.kt | 8 ++++---- .../fsck/k9/message/extractors/BasicPartInfoExtractor.kt | 1 - .../src/main/java/com/fsck/k9/message/html/UriMatcher.kt | 2 -- .../java/com/fsck/k9/notification/BaseNotifications.kt | 2 +- .../fsck/k9/notification/CertificateErrorNotifications.kt | 2 +- .../java/com/fsck/k9/notification/DeviceNotifications.kt | 1 - .../com/fsck/k9/notification/LockScreenNotification.kt | 2 +- .../com/fsck/k9/notification/NotificationActionCreator.kt | 1 - .../com/fsck/k9/notification/NotificationActionService.kt | 1 - .../java/com/fsck/k9/notification/NotificationContent.kt | 2 +- .../com/fsck/k9/notification/NotificationController.kt | 2 +- .../java/com/fsck/k9/notification/NotificationData.kt | 2 +- .../com/fsck/k9/notification/NotificationGroupKeys.kt | 2 +- .../java/com/fsck/k9/notification/NotificationHelper.kt | 2 +- .../java/com/fsck/k9/notification/NotificationHolder.kt | 2 +- .../java/com/fsck/k9/notification/SyncNotifications.kt | 2 +- .../java/com/fsck/k9/notification/WearNotifications.kt | 4 ++-- .../main/java/com/fsck/k9/power/TracingPowerManager.kt | 3 +-- .../src/main/java/com/fsck/k9/preferences/KoinModule.kt | 2 +- .../java/com/fsck/k9/preferences/ServerTypeConverter.kt | 2 -- .../notification/AuthenticationErrorNotificationsTest.kt | 2 +- .../k9/notification/CertificateErrorNotificationsTest.kt | 2 +- .../fsck/k9/notification/LockScreenNotificationTest.kt | 3 +-- .../k9/notification/NotificationContentCreatorTest.kt | 1 - .../java/com/fsck/k9/notification/NotificationDataTest.kt | 2 +- .../fsck/k9/notification/SendFailedNotificationsTest.kt | 2 +- .../com/fsck/k9/notification/SyncNotificationsTest.kt | 3 +-- .../com/fsck/k9/notification/WearNotificationsTest.kt | 2 +- .../java/com/fsck/k9/preferences/SettingsExporterTest.kt | 2 +- .../java/com/fsck/k9/backends/WebDavBackendFactory.kt | 3 +-- .../fsck/k9/notification/K9NotificationActionCreator.kt | 2 +- .../com/fsck/k9/notification/K9NotificationStrategy.kt | 4 ++-- .../src/main/java/com/fsck/k9/widget/unread/KoinModule.kt | 2 +- .../fsck/k9/widget/unread/UnreadWidgetDataProviderTest.kt | 1 - .../com/fsck/k9/storage/messages/DatabaseOperations.kt | 3 +-- .../fsck/k9/storage/messages/RetrieveFolderOperations.kt | 2 +- .../com/fsck/k9/storage/messages/SaveMessageOperations.kt | 1 - .../fsck/k9/storage/messages/ThreadMessageOperations.kt | 1 - .../java/com/fsck/k9/storage/migrations/MigrationTo80.kt | 2 +- .../src/main/java/com/fsck/k9/testing/MockHelper.kt | 2 +- 47 files changed, 44 insertions(+), 63 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/K9.kt b/app/core/src/main/java/com/fsck/k9/K9.kt index 9e176d6cd0..d6543a22ac 100644 --- a/app/core/src/main/java/com/fsck/k9/K9.kt +++ b/app/core/src/main/java/com/fsck/k9/K9.kt @@ -155,7 +155,7 @@ object K9 : EarlyInit { @JvmStatic var isConfirmMarkAllRead = true - @JvmStatic + @JvmStatic var notificationQuickDeleteBehaviour = NotificationQuickDelete.ALWAYS @JvmStatic @@ -375,7 +375,7 @@ object K9 : EarlyInit { k9Language = storage.getString("language", "") - appTheme = AppTheme.FOLLOW_SYSTEM //storage.getEnum("theme", AppTheme.FOLLOW_SYSTEM) + appTheme = AppTheme.FOLLOW_SYSTEM // storage.getEnum("theme", AppTheme.FOLLOW_SYSTEM) messageViewTheme = storage.getEnum("messageViewTheme", SubTheme.USE_GLOBAL) messageComposeTheme = storage.getEnum("messageComposeTheme", SubTheme.USE_GLOBAL) @@ -523,7 +523,6 @@ object K9 : EarlyInit { ALWAYS, NEVER, WHEN_CHECKED_AUTO_SYNC } - /** * Controls behaviour of delete button in notifications. */ diff --git a/app/core/src/main/java/com/fsck/k9/Preferences.kt b/app/core/src/main/java/com/fsck/k9/Preferences.kt index 549d59e7f9..0bcc7aad57 100644 --- a/app/core/src/main/java/com/fsck/k9/Preferences.kt +++ b/app/core/src/main/java/com/fsck/k9/Preferences.kt @@ -3,6 +3,7 @@ package com.fsck.k9 import android.content.Context import androidx.annotation.GuardedBy import androidx.annotation.RestrictTo +import com.fsck.k9.helper.sendBlockingSilently import com.fsck.k9.mail.MessagingException import com.fsck.k9.mailstore.LocalStoreProvider import com.fsck.k9.preferences.AccountManager @@ -23,7 +24,6 @@ import kotlinx.coroutines.flow.buffer import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.flowOn import timber.log.Timber -import com.fsck.k9.helper.sendBlockingSilently class Preferences internal constructor( private val storagePersister: StoragePersister, diff --git a/app/core/src/main/java/com/fsck/k9/controller/MessageCountsProvider.kt b/app/core/src/main/java/com/fsck/k9/controller/MessageCountsProvider.kt index 1d3764ce6a..3ac2bdb8e3 100644 --- a/app/core/src/main/java/com/fsck/k9/controller/MessageCountsProvider.kt +++ b/app/core/src/main/java/com/fsck/k9/controller/MessageCountsProvider.kt @@ -62,4 +62,4 @@ internal class DefaultMessageCountsProvider( MessageCounts(0, 0) } } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/controller/NotificationState.kt b/app/core/src/main/java/com/fsck/k9/controller/NotificationState.kt index f9878abfb0..32306f5b25 100644 --- a/app/core/src/main/java/com/fsck/k9/controller/NotificationState.kt +++ b/app/core/src/main/java/com/fsck/k9/controller/NotificationState.kt @@ -3,4 +3,4 @@ package com.fsck.k9.controller class NotificationState { @get:JvmName("wasNotified") var wasNotified: Boolean = false -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt b/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt index 9688b95db8..c735c20bc6 100644 --- a/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt +++ b/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushController.kt @@ -7,13 +7,12 @@ import com.fsck.k9.backend.BackendManager import com.fsck.k9.backend.api.BackendPusher import com.fsck.k9.backend.api.BackendPusherCallback import com.fsck.k9.controller.MessagingController -import com.fsck.k9.mailstore.FolderRepositoryManager +import com.fsck.k9.mailstore.FolderRepository import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.cancel import kotlinx.coroutines.flow.collect -import com.fsck.k9.mailstore.FolderRepository import kotlinx.coroutines.launch import timber.log.Timber @@ -101,4 +100,4 @@ internal class AccountPushController( account.folderPushMode = FolderMode.NONE preferences.saveAccount(account) } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt b/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt index edadccbda4..7091496d69 100644 --- a/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt +++ b/app/core/src/main/java/com/fsck/k9/controller/push/AccountPushControllerFactory.kt @@ -1,9 +1,9 @@ package com.fsck.k9.controller.push import com.fsck.k9.Account +import com.fsck.k9.Preferences import com.fsck.k9.backend.BackendManager import com.fsck.k9.controller.MessagingController -import com.fsck.k9.Preferences import com.fsck.k9.mailstore.FolderRepository internal class AccountPushControllerFactory( diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt b/app/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt index e59b592b90..a0d09d1328 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/AutoExpandFolderBackendFoldersRefreshListener.kt @@ -6,7 +6,7 @@ import com.fsck.k9.Preferences /** * Update an Account's auto-expand folder after the folder list has been refreshed. */ -class AutoExpandFolderBackendFoldersRefreshListener( +class AutoExpandFolderBackendFoldersRefreshListener( private val preferences: Preferences, private val account: Account, private val folderRepository: FolderRepository diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt index 4629003a5a..337db8d954 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt @@ -2,6 +2,10 @@ package com.fsck.k9.mailstore import com.fsck.k9.Account import com.fsck.k9.Account.FolderMode +import com.fsck.k9.DI +import com.fsck.k9.controller.MessagingController +import com.fsck.k9.controller.SimpleMessagingListener +import com.fsck.k9.helper.sendBlockingSilently import com.fsck.k9.mail.FolderClass import com.fsck.k9.preferences.AccountManager import kotlinx.coroutines.CoroutineDispatcher @@ -17,10 +21,6 @@ import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map import com.fsck.k9.mail.FolderType as RemoteFolderType -import com.fsck.k9.DI -import com.fsck.k9.controller.MessagingController -import com.fsck.k9.controller.SimpleMessagingListener -import com.fsck.k9.helper.sendBlockingSilently @OptIn(ExperimentalCoroutinesApi::class) class FolderRepository( diff --git a/app/core/src/main/java/com/fsck/k9/message/extractors/BasicPartInfoExtractor.kt b/app/core/src/main/java/com/fsck/k9/message/extractors/BasicPartInfoExtractor.kt index d8b2d830ce..6992a87a4a 100644 --- a/app/core/src/main/java/com/fsck/k9/message/extractors/BasicPartInfoExtractor.kt +++ b/app/core/src/main/java/com/fsck/k9/message/extractors/BasicPartInfoExtractor.kt @@ -4,7 +4,6 @@ import com.fsck.k9.mail.Part import com.fsck.k9.mail.internet.MimeParameterDecoder import com.fsck.k9.mail.internet.MimeUtility import com.fsck.k9.mail.internet.MimeValue -import java.util.Locale private const val FALLBACK_NAME = "noname" diff --git a/app/core/src/main/java/com/fsck/k9/message/html/UriMatcher.kt b/app/core/src/main/java/com/fsck/k9/message/html/UriMatcher.kt index 4051fb3521..dd19edb4b3 100644 --- a/app/core/src/main/java/com/fsck/k9/message/html/UriMatcher.kt +++ b/app/core/src/main/java/com/fsck/k9/message/html/UriMatcher.kt @@ -1,7 +1,5 @@ package com.fsck.k9.message.html -import java.util.Locale - object UriMatcher { private val SUPPORTED_URIS = run { val httpUriParser = HttpUriParser() diff --git a/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.kt index 5e3c61f58e..01c09b185b 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/BaseNotifications.kt @@ -57,4 +57,4 @@ internal abstract class BaseNotifications( protected open fun createBigTextStyle(builder: NotificationCompat.Builder?): NotificationCompat.BigTextStyle { return NotificationCompat.BigTextStyle(builder) } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.kt index aebd29d12a..36d99a872f 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/CertificateErrorNotifications.kt @@ -56,4 +56,4 @@ internal open class CertificateErrorNotifications( private val notificationManager: NotificationManagerCompat get() = notificationHelper.getNotificationManager() -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt index 5a6315be3d..1fe8127663 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt @@ -207,4 +207,3 @@ internal open class DeviceNotifications( return NotificationCompat.InboxStyle(builder) } } - diff --git a/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.kt b/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.kt index f13e21f315..f1702ad525 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/LockScreenNotification.kt @@ -80,4 +80,4 @@ internal class LockScreenNotification( companion object { const val MAX_NUMBER_OF_SENDERS_IN_LOCK_SCREEN_NOTIFICATION = 5 } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt index 851cfec33f..d880d8ff90 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt @@ -54,4 +54,3 @@ interface NotificationActionCreator { fun createMarkMessageAsSpamPendingIntent(messageReference: MessageReference, notificationId: Int): PendingIntent } - diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt index a91bf70439..cbfc7b645e 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt @@ -229,4 +229,3 @@ class NotificationActionService : Service() { } } } - diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationContent.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationContent.kt index 715317387c..ed791dc41b 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationContent.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationContent.kt @@ -9,4 +9,4 @@ internal class NotificationContent( val preview: CharSequence, val summary: CharSequence, val isStarred: Boolean -) \ No newline at end of file +) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationController.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationController.kt index 4fa4c0c4f4..ee0be2c380 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationController.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationController.kt @@ -72,4 +72,4 @@ class NotificationController internal constructor( fun clearNewMailNotifications(account: Account) { newMailNotifications.clearNewMailNotifications(account) } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationData.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationData.kt index c153ed9cd3..9efb9c2d21 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationData.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationData.kt @@ -148,4 +148,4 @@ internal class NotificationData(val account: Account, private val initialUnreadM const val MAX_NUMBER_OF_MESSAGES_FOR_SUMMARY_NOTIFICATION = 5 const val MAX_NUMBER_OF_STACKED_NOTIFICATIONS = 8 } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt index 8aa3255f66..14c150cd27 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationGroupKeys.kt @@ -9,4 +9,4 @@ object NotificationGroupKeys { fun getGroupKey(account: Account): String { return NOTIFICATION_GROUP_KEY_PREFIX + account.accountNumber } -} \ No newline at end of file +} 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 e8045884ff..62d693c338 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 @@ -35,7 +35,7 @@ class NotificationHelper( if (vibrationPattern != null) { builder.setVibrate(vibrationPattern) } - }else { + } else { builder.setNotificationSilent() } diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationHolder.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationHolder.kt index d892935764..d60dfb635a 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationHolder.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationHolder.kt @@ -3,4 +3,4 @@ package com.fsck.k9.notification internal class NotificationHolder( val notificationId: Int, val content: NotificationContent -) \ No newline at end of file +) diff --git a/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.kt index 4905b23d5e..415cb4b257 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SyncNotifications.kt @@ -121,7 +121,7 @@ internal class SyncNotifications( notificationManager.notify(notificationId, notificationBuilder.build()) } - + fun clearFetchingMailNotification(account: Account) { val notificationId = NotificationIds.getFetchingMailNotificationId(account) notificationManager.cancel(notificationId) diff --git a/app/core/src/main/java/com/fsck/k9/notification/WearNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/WearNotifications.kt index b6df3fe506..e456081639 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/WearNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/WearNotifications.kt @@ -67,7 +67,7 @@ internal open class WearNotifications( val action = actionCreator.createDeleteAllPendingIntent(account, messageReferences, notificationId) val deleteAction = NotificationCompat.Action.Builder(icon, title, action).build() - wearableExtender.addAction(deleteAction); + wearableExtender.addAction(deleteAction) wearableExtender.addAction(deleteAction) } @@ -229,4 +229,4 @@ internal open class WearNotifications( protected open fun createMessagingController(): MessagingController { return MessagingController.getInstance(context) } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/power/TracingPowerManager.kt b/app/core/src/main/java/com/fsck/k9/power/TracingPowerManager.kt index 9b410baebe..da69412dea 100644 --- a/app/core/src/main/java/com/fsck/k9/power/TracingPowerManager.kt +++ b/app/core/src/main/java/com/fsck/k9/power/TracingPowerManager.kt @@ -46,7 +46,6 @@ class TracingPowerManager private constructor(context: Context) : PowerManager { startTime = SystemClock.elapsedRealtime() } - this.timeout = timeout } @@ -109,4 +108,4 @@ class TracingPowerManager private constructor(context: Context) : PowerManager { return TracingPowerManager(appContext) } } -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt b/app/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt index b7e1ee3e86..8d1ca4c88a 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt @@ -22,4 +22,4 @@ val preferencesModule = module { coroutineScope = get(named("AppCoroutineScope")) ) } bind GeneralSettingsManager::class -} \ No newline at end of file +} diff --git a/app/core/src/main/java/com/fsck/k9/preferences/ServerTypeConverter.kt b/app/core/src/main/java/com/fsck/k9/preferences/ServerTypeConverter.kt index 7f2c77eb3f..9d64def8b3 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/ServerTypeConverter.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/ServerTypeConverter.kt @@ -1,7 +1,5 @@ package com.fsck.k9.preferences -import java.util.Locale - object ServerTypeConverter { @JvmStatic fun toServerSettingsType(exportType: String): String = exportType.lowercase() diff --git a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.kt index 51faec8421..774ccd6067 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/AuthenticationErrorNotificationsTest.kt @@ -104,4 +104,4 @@ class AuthenticationErrorNotificationsTest : RobolectricTest() { return contentIntent } } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.kt index 869b91218a..20bbfd3ebb 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/CertificateErrorNotificationsTest.kt @@ -101,4 +101,4 @@ class CertificateErrorNotificationsTest : RobolectricTest() { return contentIntent } } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.kt b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.kt index cd8d7c60c5..e2e15fdf00 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/LockScreenNotificationTest.kt @@ -96,7 +96,7 @@ class LockScreenNotificationTest : RobolectricTest() { verify(publicBuilder).setSmallIcon(resourceProvider.iconNewMail) verify(publicBuilder).setNumber(UNREAD_MESSAGE_COUNT) verify(publicBuilder).setContentTitle("$NEW_MESSAGE_COUNT new messages") - verify(builder).setPublicVersion(publicBuilder.build()); + verify(builder).setPublicVersion(publicBuilder.build()) verify(publicBuilder).setContentText( "alice@example.com, Bob , \"Peter Lustig\" " ) @@ -178,4 +178,3 @@ class LockScreenNotificationTest : RobolectricTest() { return NotificationContent(messageReference, sender, "irrelevant", "irrelevant", "irrelevant", false) } } - diff --git a/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt index 17a5aceebb..b4efe2f3af 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/NotificationContentCreatorTest.kt @@ -158,4 +158,3 @@ class NotificationContentCreatorTest : RobolectricTest() { } } } - diff --git a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataTest.kt index 989048e5f8..a52d15627c 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/NotificationDataTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/NotificationDataTest.kt @@ -283,4 +283,4 @@ class NotificationDataTest : RobolectricTest() { val messageReference = createMessageReference("42") return NotificationContent(messageReference, "", "", "", "", true) } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.kt index d36a830a23..80c9e72a97 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/SendFailedNotificationsTest.kt @@ -83,4 +83,4 @@ class SendFailedNotificationsTest : RobolectricTest() { on { createViewFolderListPendingIntent(any(), anyInt()) } doReturn contentIntent } } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.kt index dfe118fe20..b97bd0dc1b 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/SyncNotificationsTest.kt @@ -89,7 +89,6 @@ class SyncNotificationsTest : RobolectricTest() { verify(builder).setVisibility(NotificationCompat.VISIBILITY_PUBLIC) } - @Test fun testClearSendFailedNotification() { val notificationId = getFetchingMailNotificationId(account) @@ -135,4 +134,4 @@ class SyncNotificationsTest : RobolectricTest() { on { name } doReturn FOLDER_NAME } } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.kt index 624d9157e5..6d9a2fdc49 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/WearNotificationsTest.kt @@ -309,4 +309,4 @@ class WearNotificationsTest : RobolectricTest() { return messagingController } } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/preferences/SettingsExporterTest.kt b/app/core/src/test/java/com/fsck/k9/preferences/SettingsExporterTest.kt index d29f4cd9f9..b92e017ba3 100644 --- a/app/core/src/test/java/com/fsck/k9/preferences/SettingsExporterTest.kt +++ b/app/core/src/test/java/com/fsck/k9/preferences/SettingsExporterTest.kt @@ -2,10 +2,10 @@ package com.fsck.k9.preferences import com.fsck.k9.K9RobolectricTest import com.fsck.k9.Preferences +import com.fsck.k9.mailstore.FolderRepository import java.io.ByteArrayOutputStream import org.jdom2.Document import org.jdom2.input.SAXBuilder -import com.fsck.k9.mailstore.FolderRepository import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull import org.junit.Assert.assertNull diff --git a/app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt b/app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt index 02f56374ff..0098b96e46 100644 --- a/app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt +++ b/app/k9mail/src/main/java/com/fsck/k9/backends/WebDavBackendFactory.kt @@ -8,7 +8,6 @@ import com.fsck.k9.mail.ssl.TrustManagerFactory import com.fsck.k9.mail.store.webdav.DraftsFolderProvider import com.fsck.k9.mail.store.webdav.WebDavStore import com.fsck.k9.mail.transport.WebDavTransport - import com.fsck.k9.mailstore.FolderRepository import com.fsck.k9.mailstore.K9BackendStorageFactory @@ -33,4 +32,4 @@ class WebDavBackendFactory( folderRepository.getFolderServerId(account, draftsFolderId) ?: error("Couldn't find local Drafts folder") } } -} \ No newline at end of file +} diff --git a/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt b/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt index 3ad48b7476..ce5bb48dd8 100644 --- a/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt +++ b/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationActionCreator.kt @@ -233,4 +233,4 @@ internal class K9NotificationActionCreator( return if (messageReferences.all { it.folderId == folderId }) folderId else null } -} \ No newline at end of file +} diff --git a/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt b/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt index e9146434dd..37630d5e9d 100644 --- a/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt +++ b/app/k9mail/src/main/java/com/fsck/k9/notification/K9NotificationStrategy.kt @@ -4,12 +4,12 @@ import com.fsck.k9.Account import com.fsck.k9.K9 import com.fsck.k9.helper.Contacts import com.fsck.k9.mail.Flag +import com.fsck.k9.mail.K9MailLib +import com.fsck.k9.mail.Message import com.fsck.k9.mailstore.LocalFolder import com.fsck.k9.mailstore.LocalFolder.isModeMismatch import com.fsck.k9.mailstore.LocalMessage import timber.log.Timber -import com.fsck.k9.mail.K9MailLib -import com.fsck.k9.mail.Message class K9NotificationStrategy(private val contacts: Contacts) : NotificationStrategy { diff --git a/app/k9mail/src/main/java/com/fsck/k9/widget/unread/KoinModule.kt b/app/k9mail/src/main/java/com/fsck/k9/widget/unread/KoinModule.kt index 8eb8d42c18..1cae6a4fde 100644 --- a/app/k9mail/src/main/java/com/fsck/k9/widget/unread/KoinModule.kt +++ b/app/k9mail/src/main/java/com/fsck/k9/widget/unread/KoinModule.kt @@ -17,4 +17,4 @@ val unreadWidgetModule = module { single { UnreadWidgetUpdater(context = get()) } single { UnreadWidgetUpdateListener(unreadWidgetUpdater = get()) } single { UnreadWidgetMigrations(accountRepository = get(), folderRepository = get()) } -} \ No newline at end of file +} diff --git a/app/k9mail/src/test/java/com/fsck/k9/widget/unread/UnreadWidgetDataProviderTest.kt b/app/k9mail/src/test/java/com/fsck/k9/widget/unread/UnreadWidgetDataProviderTest.kt index c68eb93cf7..e701181fb1 100644 --- a/app/k9mail/src/test/java/com/fsck/k9/widget/unread/UnreadWidgetDataProviderTest.kt +++ b/app/k9mail/src/test/java/com/fsck/k9/widget/unread/UnreadWidgetDataProviderTest.kt @@ -101,7 +101,6 @@ class UnreadWidgetDataProviderTest : AppRobolectricTest() { on { getDefaultFolder(account) } doReturn FOLDER_ID } - fun createFolderRepository(): FolderRepository { return mock { on { getFolder(account, FOLDER_ID) } doReturn FOLDER diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/DatabaseOperations.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/DatabaseOperations.kt index 2aff1365c1..1558190c6b 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/DatabaseOperations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/DatabaseOperations.kt @@ -1,6 +1,5 @@ package com.fsck.k9.storage.messages - import com.fsck.k9.mailstore.LockableDatabase import com.fsck.k9.mailstore.StorageManager import timber.log.Timber @@ -38,4 +37,4 @@ internal class DatabaseOperations( Timber.i("After compaction size = %d", getSize()) } -} \ No newline at end of file +} diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/RetrieveFolderOperations.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/RetrieveFolderOperations.kt index 37e5e49cae..08c5eaebf1 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/RetrieveFolderOperations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/RetrieveFolderOperations.kt @@ -1,6 +1,7 @@ package com.fsck.k9.storage.messages import android.database.Cursor +import androidx.core.database.getLongOrNull import com.fsck.k9.Account.FolderMode import com.fsck.k9.helper.map import com.fsck.k9.mail.FolderClass @@ -10,7 +11,6 @@ import com.fsck.k9.mailstore.FolderMapper import com.fsck.k9.mailstore.LockableDatabase import com.fsck.k9.mailstore.MoreMessages import com.fsck.k9.mailstore.toFolderType -import androidx.core.database.getLongOrNull internal class RetrieveFolderOperations(private val lockableDatabase: LockableDatabase) { fun getFolder(folderId: Long, mapper: FolderMapper): T? { diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/SaveMessageOperations.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/SaveMessageOperations.kt index 827644bfcc..49080c0507 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/SaveMessageOperations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/SaveMessageOperations.kt @@ -28,7 +28,6 @@ import java.io.FileInputStream import java.io.FileOutputStream import java.io.IOException import java.io.InputStream -import java.util.Locale import java.util.Stack import java.util.UUID import org.apache.commons.io.IOUtils diff --git a/app/storage/src/main/java/com/fsck/k9/storage/messages/ThreadMessageOperations.kt b/app/storage/src/main/java/com/fsck/k9/storage/messages/ThreadMessageOperations.kt index cb503dd65a..52544b1f4b 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/messages/ThreadMessageOperations.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/messages/ThreadMessageOperations.kt @@ -5,7 +5,6 @@ import android.database.sqlite.SQLiteDatabase import com.fsck.k9.helper.Utility import com.fsck.k9.mail.Message import com.fsck.k9.mail.message.MessageHeaderParser -import java.util.Locale internal class ThreadMessageOperations { diff --git a/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo80.kt b/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo80.kt index 3cc4cc30c3..c435d9ead4 100644 --- a/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo80.kt +++ b/app/storage/src/main/java/com/fsck/k9/storage/migrations/MigrationTo80.kt @@ -9,4 +9,4 @@ internal class MigrationTo80(private val db: SQLiteDatabase) { fun rewriteLastUpdatedColumn() { db.execSQL("UPDATE folders SET last_updated = NULL WHERE last_updated = 0") } -} \ No newline at end of file +} diff --git a/app/testing/src/main/java/com/fsck/k9/testing/MockHelper.kt b/app/testing/src/main/java/com/fsck/k9/testing/MockHelper.kt index 3334063d61..17e9e6986e 100644 --- a/app/testing/src/main/java/com/fsck/k9/testing/MockHelper.kt +++ b/app/testing/src/main/java/com/fsck/k9/testing/MockHelper.kt @@ -20,4 +20,4 @@ object MockHelper { inline fun mockBuilder(stubbing: KStubbing.(T) -> Unit = {}): T { return mockBuilder(T::class.java).apply { KStubbing(this).stubbing(this) } } -} \ No newline at end of file +} -- GitLab From 31e9d13ed96b8525bb88e0e0b9a64140b5654dda Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 20 Dec 2021 10:51:13 +0530 Subject: [PATCH 4/7] build successful - fix build --- .../com/fsck/k9/mailstore/FolderRepository.kt | 2 +- .../com/fsck/k9/mailstore/LocalMessage.java | 2 +- .../k9/notification/DeviceNotifications.kt | 28 +++++++++---------- .../notification/NotificationActionCreator.kt | 2 ++ .../notification/NotificationActionService.kt | 9 ++++++ .../notification/SendFailedNotifications.kt | 3 ++ .../fsck/k9/preferences/SettingsExporter.kt | 2 +- app/ui/base/build.gradle | 2 ++ app/ui/base/src/main/res/color/star_color.xml | 4 +-- app/ui/base/src/main/res/values/styles.xml | 2 +- .../src/main/res/drawable/btn_check_star.xml | 5 ++-- 11 files changed, 39 insertions(+), 22 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt index 337db8d954..0b6d1456da 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt @@ -26,7 +26,7 @@ import com.fsck.k9.mail.FolderType as RemoteFolderType class FolderRepository( private val messageStoreManager: MessageStoreManager, private val accountManager: AccountManager, - private val account: Account, + //private val account: Account, private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO ) { private val sortForDisplay = diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java b/app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java index ca429acffc..2d2c2b95d2 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java +++ b/app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java @@ -24,7 +24,7 @@ import com.fsck.k9.mail.internet.AddressHeaderBuilder; import com.fsck.k9.mail.internet.MimeMessage; import com.fsck.k9.mail.message.MessageHeaderParser; import com.fsck.k9.mailstore.LockableDatabase.DbCallback; -import com.fsck.k9.mailstore.LockableDatabase.WrappedException; +//import com.fsck.k9.mailstore.LockableDatabase.WrappedException; import com.fsck.k9.message.extractors.PreviewResult.PreviewType; import timber.log.Timber; diff --git a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt index 1fe8127663..8077b69bb0 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt @@ -6,7 +6,7 @@ import android.content.Context import androidx.core.app.NotificationCompat import com.fsck.k9.Account import com.fsck.k9.K9 -import com.fsck.k9.K9.NotificationHideSubject +//import com.fsck.k9.K9.NotificationHideSubject import com.fsck.k9.K9.NotificationQuickDelete import com.fsck.k9.notification.NotificationGroupKeys.getGroupKey import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId @@ -23,9 +23,9 @@ internal open class DeviceNotifications( val unreadMessageCount = notificationData.unreadMessageCount val builder = when { - isPrivacyModeActive -> { - createSimpleSummaryNotification(account, unreadMessageCount) - } +// isPrivacyModeActive -> { +// createSimpleSummaryNotification(account, unreadMessageCount) +// } notificationData.isSingleMessageNotification -> { val holder = notificationData.holderForLatestNotification createBigTextStyleSummaryNotification(account, holder) @@ -62,14 +62,14 @@ internal open class DeviceNotifications( val newMailText = resourceProvider.newMailTitle() val unreadMessageCountText = resourceProvider.newMailUnreadMessageCount(unreadMessageCount, accountName) val notificationId = getNewMailSummaryNotificationId(account) - val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId) + // val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId) return createAndInitializeNotificationBuilder(account) .setNumber(unreadMessageCount) .setTicker(newMailText) .setContentTitle(unreadMessageCountText) .setContentText(newMailText) - .setContentIntent(contentIntent) + //.setContentIntent(contentIntent) } private fun createBigTextStyleSummaryNotification( @@ -194,14 +194,14 @@ internal open class DeviceNotifications( builder.addAction(icon, title, replyToMessagePendingIntent) } - private val isPrivacyModeActive: Boolean - get() { - val keyguardService = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager - val privacyModeAlwaysEnabled = K9.notificationHideSubject === NotificationHideSubject.ALWAYS - val privacyModeEnabledWhenLocked = K9.notificationHideSubject === NotificationHideSubject.WHEN_LOCKED - val screenLocked = keyguardService.inKeyguardRestrictedInputMode() - return privacyModeAlwaysEnabled || privacyModeEnabledWhenLocked && screenLocked - } +// private val isPrivacyModeActive: Boolean +// get() { +// val keyguardService = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager +// val privacyModeAlwaysEnabled = K9.notificationHideSubject === NotificationHideSubject.ALWAYS +// val privacyModeEnabledWhenLocked = K9.notificationHideSubject === NotificationHideSubject.WHEN_LOCKED +// val screenLocked = keyguardService.inKeyguardRestrictedInputMode() +// return privacyModeAlwaysEnabled || privacyModeEnabledWhenLocked && screenLocked +// } protected open fun createInboxStyle(builder: NotificationCompat.Builder?): NotificationCompat.InboxStyle { return NotificationCompat.InboxStyle(builder) diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt index d880d8ff90..426ded2b4c 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt @@ -14,6 +14,8 @@ interface NotificationActionCreator { notificationId: Int ): PendingIntent + fun createViewFolderListPendingIntent(account: Account, notificationId: Int): PendingIntent + fun createDismissAllMessagesPendingIntent(account: Account, notificationId: Int): PendingIntent fun createDismissMessagePendingIntent( diff --git a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt index cbfc7b645e..3f6ddaac7c 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt @@ -56,8 +56,17 @@ class NotificationActionService : Service() { } } +// private fun deleteMessages(intent: Intent) { +// Timber.i("NotificationActionService deleting messages") +// messagingController.deleteMessages(messageReferences) +// } + private fun deleteMessages(intent: Intent) { Timber.i("NotificationActionService deleting messages") + + val messageReferenceStrings = intent.getStringArrayListExtra(EXTRA_MESSAGE_REFERENCES) + val messageReferences = MessageReferenceHelper.toMessageReferenceList(messageReferenceStrings) + messagingController.deleteMessages(messageReferences) } diff --git a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.kt index 176704aa1b..02e67eb7a3 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/SendFailedNotifications.kt @@ -15,6 +15,9 @@ internal class SendFailedNotifications( val text = ExceptionHelper.getRootCauseMessage(exception) val notificationId = NotificationIds.getSendFailedNotificationId(account) +// val folderListPendingIntent = actionBuilder.createViewFolderListPendingIntent( +// account, notificationId +// ) val folderListPendingIntent = actionBuilder.createViewFolderListPendingIntent( account, notificationId ) diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt index 35db0adecf..cc0053fcbd 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt @@ -210,7 +210,7 @@ class SettingsExporter( } } - val folderRepository = folderRepositoryManager.getFolderRepository(account) + //val folderRepository = folderRepositoryManager.getFolderRepository(account) writeFolderNameSettings(account, folderRepository, serializer) serializer.endTag(null, SETTINGS_ELEMENT) diff --git a/app/ui/base/build.gradle b/app/ui/base/build.gradle index eb7661cc2e..d3d54778f6 100644 --- a/app/ui/base/build.gradle +++ b/app/ui/base/build.gradle @@ -14,6 +14,7 @@ dependencies { implementation "androidx.biometric:biometric:${versions.androidxBiometric}" implementation "com.jakewharton.timber:timber:${versions.timber}" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.kotlinCoroutines}" + } android { @@ -38,4 +39,5 @@ android { kotlinOptions { jvmTarget = kotlinJvmVersion } + } diff --git a/app/ui/base/src/main/res/color/star_color.xml b/app/ui/base/src/main/res/color/star_color.xml index 63583273b8..807e52c6f8 100644 --- a/app/ui/base/src/main/res/color/star_color.xml +++ b/app/ui/base/src/main/res/color/star_color.xml @@ -1,5 +1,5 @@ - - + diff --git a/app/ui/base/src/main/res/values/styles.xml b/app/ui/base/src/main/res/values/styles.xml index 72ac176859..59b27f6b19 100644 --- a/app/ui/base/src/main/res/values/styles.xml +++ b/app/ui/base/src/main/res/values/styles.xml @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/app/ui/legacy/src/main/res/drawable/btn_check_star.xml b/app/ui/legacy/src/main/res/drawable/btn_check_star.xml index 339bb25283..a1176e5a08 100644 --- a/app/ui/legacy/src/main/res/drawable/btn_check_star.xml +++ b/app/ui/legacy/src/main/res/drawable/btn_check_star.xml @@ -1,5 +1,6 @@ - - + + + -- GitLab From ea9c5d733fb1bad94a94e8a4fb176a07e42b068f Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 20 Dec 2021 11:33:51 +0530 Subject: [PATCH 5/7] ./gradlew ktlintFormat --- .../main/java/com/fsck/k9/mailstore/FolderRepository.kt | 2 +- .../java/com/fsck/k9/notification/DeviceNotifications.kt | 8 +++----- .../main/java/com/fsck/k9/preferences/SettingsExporter.kt | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt index 0b6d1456da..0708e24fc3 100644 --- a/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt +++ b/app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt @@ -26,7 +26,7 @@ import com.fsck.k9.mail.FolderType as RemoteFolderType class FolderRepository( private val messageStoreManager: MessageStoreManager, private val accountManager: AccountManager, - //private val account: Account, + // private val account: Account, private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO ) { private val sortForDisplay = diff --git a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt index 8077b69bb0..98b0357a86 100644 --- a/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt +++ b/app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt @@ -1,12 +1,10 @@ package com.fsck.k9.notification -import android.app.KeyguardManager import android.app.Notification -import android.content.Context import androidx.core.app.NotificationCompat import com.fsck.k9.Account import com.fsck.k9.K9 -//import com.fsck.k9.K9.NotificationHideSubject +// import com.fsck.k9.K9.NotificationHideSubject import com.fsck.k9.K9.NotificationQuickDelete import com.fsck.k9.notification.NotificationGroupKeys.getGroupKey import com.fsck.k9.notification.NotificationIds.getNewMailSummaryNotificationId @@ -62,14 +60,14 @@ internal open class DeviceNotifications( val newMailText = resourceProvider.newMailTitle() val unreadMessageCountText = resourceProvider.newMailUnreadMessageCount(unreadMessageCount, accountName) val notificationId = getNewMailSummaryNotificationId(account) - // val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId) + // val contentIntent = actionCreator.createViewFolderListPendingIntent(account, notificationId) return createAndInitializeNotificationBuilder(account) .setNumber(unreadMessageCount) .setTicker(newMailText) .setContentTitle(unreadMessageCountText) .setContentText(newMailText) - //.setContentIntent(contentIntent) + // .setContentIntent(contentIntent) } private fun createBigTextStyleSummaryNotification( diff --git a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt index cc0053fcbd..d0e56370e6 100644 --- a/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt +++ b/app/core/src/main/java/com/fsck/k9/preferences/SettingsExporter.kt @@ -210,7 +210,7 @@ class SettingsExporter( } } - //val folderRepository = folderRepositoryManager.getFolderRepository(account) + // val folderRepository = folderRepositoryManager.getFolderRepository(account) writeFolderNameSettings(account, folderRepository, serializer) serializer.endTag(null, SETTINGS_ELEMENT) -- GitLab From 51b62e4eadb6c01101b0f96622ce63c37de1a43b Mon Sep 17 00:00:00 2001 From: Narinder Rana Date: Mon, 20 Dec 2021 12:11:05 +0530 Subject: [PATCH 6/7] build succeed - fix build on studio --- .../com/fsck/k9/activity/compose/RecipientMvpView.kt | 12 ++++++++++++ .../k9/ui/managefolders/FolderSettingsDataStore.kt | 4 ++-- .../ui/settings/account/AccountSettingsViewModel.kt | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt index f88fc6f3f0..d539e021d7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt @@ -379,15 +379,27 @@ class RecipientMvpView(private val activity: MessageCompose) : View.OnFocusChang bccView.setLoaderManager(loaderManager) } +// enum class CryptoStatusDisplayType(val childIdToDisplay: Int) { +// UNCONFIGURED(VIEW_INDEX_HIDDEN), +// UNINITIALIZED(VIEW_INDEX_HIDDEN), +// SIGN_ONLY(R.id.crypto_status_disabled), +// ENABLED_TRUSTED(R.id.crypto_status_trusted), +// AVAILABLE(R.id.crypto_status_disabled), +// ERROR(R.id.crypto_status_error); +// } enum class CryptoStatusDisplayType(val childIdToDisplay: Int) { UNCONFIGURED(VIEW_INDEX_HIDDEN), UNINITIALIZED(VIEW_INDEX_HIDDEN), SIGN_ONLY(R.id.crypto_status_disabled), + UNAVAILABLE(VIEW_INDEX_HIDDEN), + ENABLED(R.id.crypto_status_enabled), + ENABLED_ERROR(R.id.crypto_status_error), ENABLED_TRUSTED(R.id.crypto_status_trusted), AVAILABLE(R.id.crypto_status_disabled), ERROR(R.id.crypto_status_error); } + enum class CryptoSpecialModeDisplayType(val childIdToDisplay: Int) { NONE(VIEW_INDEX_HIDDEN), PGP_INLINE(R.id.crypto_special_inline), diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt index d6938b94c8..de96ac027a 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt @@ -12,8 +12,8 @@ import kotlinx.coroutines.launch class FolderSettingsDataStore( private val folderRepository: FolderRepository, - private var folder: FolderDetails, - private val account: Account + private val account: Account, + private var folder: FolderDetails ) : PreferenceDataStore() { private val saveScope = CoroutineScope(GlobalScope.coroutineContext + Dispatchers.IO) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt index dc1c2c44b5..686963267b 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt @@ -70,7 +70,7 @@ class AccountSettingsViewModel( foldersLiveData.value = remoteFolderInfo } } - } + private fun getAutomaticSpecialFolders(folders: List): Map { return mapOf( -- GitLab From 17d2848e997c9d45d39b1784e409a0382c3f3a3b Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Mon, 20 Dec 2021 20:48:27 +0530 Subject: [PATCH 7/7] Reformat code as per ktlint --- .../k9/message/IdentityHeaderBuilderTest.kt | 2 +- .../notification/NewMailNotificationsTest.kt | 144 +++++++++--------- .../java/com/fsck/k9/activity/MessageList.kt | 2 - .../k9/activity/compose/RecipientMvpView.kt | 2 - .../k9/activity/compose/RecipientPresenter.kt | 6 +- .../k9/activity/compose/ReplyToPresenter.kt | 2 - .../fsck/k9/activity/compose/ReplyToView.kt | 2 +- .../k9/contacts/ContactLetterExtractor.kt | 1 - .../src/main/java/com/fsck/k9/ui/K9Drawer.kt | 10 +- .../fsck/k9/ui/account/AccountImageLoader.kt | 2 +- .../com/fsck/k9/ui/account/DisplayAccount.kt | 3 +- .../ui/choosefolder/ChooseFolderViewModel.kt | 2 +- .../fsck/k9/ui/folders/FoldersViewModel.kt | 19 ++- .../java/com/fsck/k9/ui/folders/KoinModule.kt | 2 +- .../managefolders/FolderSettingsDataStore.kt | 2 +- .../managefolders/ManageFoldersViewModel.kt | 2 +- .../account/AccountSettingsFragment.kt | 2 +- .../account/AccountSettingsViewModel.kt | 1 - .../k9/view/MessageCryptoDisplayStatus.kt | 4 +- .../compose/RecipientPresenterTest.kt | 1 - .../activity/compose/ReplyToPresenterTest.kt | 5 +- .../fsck/k9/message/PgpMessageBuilderTest.kt | 2 +- .../fsck/k9/backend/imap/ImapBackendPusher.kt | 2 +- .../fsck/k9/backend/imap/ImapFolderPusher.kt | 3 +- .../k9/backend/imap/ImapPusherCallback.kt | 2 +- build.gradle | 4 +- .../main/java/com/fsck/k9/mail/MimeType.kt | 2 - .../java/com/fsck/k9/mail/ServerSettings.kt | 2 - .../k9/mail/internet/FormatFlowedHelper.kt | 3 - .../k9/mail/internet/MessageIdGenerator.kt | 3 +- .../fsck/k9/mail/internet/MimeExtensions.kt | 1 - .../k9/mail/internet/MimeParameterDecoder.kt | 1 - .../mail/internet/FormatFlowedHelperTest.kt | 1 - 33 files changed, 101 insertions(+), 141 deletions(-) diff --git a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt index 6cefafcdee..2be6075663 100644 --- a/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt +++ b/app/core/src/test/java/com/fsck/k9/message/IdentityHeaderBuilderTest.kt @@ -53,4 +53,4 @@ class IdentityHeaderBuilderTest : RobolectricTest() { ): Identity { return Identity(description, name, email, signature, signatureUse, replyTo) } -} \ No newline at end of file +} diff --git a/app/core/src/test/java/com/fsck/k9/notification/NewMailNotificationsTest.kt b/app/core/src/test/java/com/fsck/k9/notification/NewMailNotificationsTest.kt index e41b1c94bd..dd23ae05f0 100644 --- a/app/core/src/test/java/com/fsck/k9/notification/NewMailNotificationsTest.kt +++ b/app/core/src/test/java/com/fsck/k9/notification/NewMailNotificationsTest.kt @@ -7,13 +7,11 @@ import com.fsck.k9.K9RobolectricTest import com.fsck.k9.controller.MessageReference import com.fsck.k9.mailstore.LocalMessage import org.junit.Test -import org.mockito.ArgumentMatchers.anyBoolean import org.mockito.ArgumentMatchers.anyInt import org.mockito.Mockito.never import org.mockito.Mockito.times import org.mockito.Mockito.verify import org.mockito.kotlin.doReturn -import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.mockito.kotlin.stubbing import org.mockito.kotlin.whenever @@ -228,104 +226,100 @@ class NewMailNotificationsTest : K9RobolectricTest() { whenAddingContentReturn(content, AddNotificationResult.newNotification(holder)) newMailNotifications.addNewMailNotification(account, message, 3, silent = false) - newMailNotifications.clearNewMa + newMailNotifications.clearNewMailNotifications(account) + verify(notificationManager).cancel(notificationId) + verify(notificationManager).cancel(NotificationIds.getNewMailSummaryNotificationId(account)) } -} -ilNotifications(account) -verify(notificationManager).cancel(notificationId) -verify(notificationManager).cancel(NotificationIds.getNewMailSummaryNotificationId(account)) -} - -private fun createAccount(): Account { - return mock { - on { accountNumber } doReturn ACCOUNT_NUMBER + private fun createAccount(): Account { + return mock { + on { accountNumber } doReturn ACCOUNT_NUMBER + } } -} -private fun createLocalMessage(): LocalMessage = mock() + private fun createLocalMessage(): LocalMessage = mock() -private fun createNotificationContent(): NotificationContent { - val messageReference = MessageReference("irrelevant", 1, "irrelevant", null) - return NotificationContent(messageReference, "irrelevant", "irrelevant", "irrelevant", "irrelevant", false) -} + private fun createNotificationContent(): NotificationContent { + val messageReference = MessageReference("irrelevant", 1, "irrelevant", null) + return NotificationContent(messageReference, "irrelevant", "irrelevant", "irrelevant", "irrelevant", false) + } -private fun createNotificationHolder(content: NotificationContent, index: Int): NotificationHolder { - val notificationId = NotificationIds.getNewMailStackedNotificationId(account, index) - return NotificationHolder(notificationId, content) -} + private fun createNotificationHolder(content: NotificationContent, index: Int): NotificationHolder { + val notificationId = NotificationIds.getNewMailStackedNotificationId(account, index) + return NotificationHolder(notificationId, content) + } -private fun createNotificationManager(): NotificationManagerCompat = mock() + private fun createNotificationManager(): NotificationManagerCompat = mock() -private fun createNotificationHelper(notificationManager: NotificationManagerCompat): NotificationHelper { - return mock { - on { getNotificationManager() } doReturn notificationManager + private fun createNotificationHelper(notificationManager: NotificationManagerCompat): NotificationHelper { + return mock { + on { getNotificationManager() } doReturn notificationManager + } } -} -private fun createNotificationContentCreator(): NotificationContentCreator = mock() + private fun createNotificationContentCreator(): NotificationContentCreator = mock() -private fun addToNotificationContentCreator(message: LocalMessage, content: NotificationContent) { - stubbing(contentCreator) { - on { createFromMessage(account, message) } doReturn content + private fun addToNotificationContentCreator(message: LocalMessage, content: NotificationContent) { + stubbing(contentCreator) { + on { createFromMessage(account, message) } doReturn content + } } -} -private fun createDeviceNotifications(): DeviceNotifications = mock() + private fun createDeviceNotifications(): DeviceNotifications = mock() -private fun addToDeviceNotifications(notificationToReturn: Notification) { - stubbing(deviceNotifications) { - on { - buildSummaryNotification(eq(account), eq(newMailNotifications.notificationData), anyBoolean()) - } doReturn notificationToReturn + private fun addToDeviceNotifications(notificationToReturn: Notification) { + stubbing(deviceNotifications) { + on { + buildSummaryNotification(eq(account), eq(newMailNotifications.notificationData), anyBoolean()) + } doReturn notificationToReturn + } } -} -private fun createNotification(): Notification = mock() + private fun createNotification(): Notification = mock() -private fun createWearNotifications(): WearNotifications = mock() + private fun createWearNotifications(): WearNotifications = mock() -private fun createMessageReference(number: Int): MessageReference { - return MessageReference("account", 1, number.toString(), null) -} + private fun createMessageReference(number: Int): MessageReference { + return MessageReference("account", 1, number.toString(), null) + } -private fun addToWearNotifications(notificationHolder: NotificationHolder, notificationToReturn: Notification) { - whenever(wearNotifications.buildStackedNotification(account, notificationHolder)) - .thenReturn(notificationToReturn) -} + private fun addToWearNotifications(notificationHolder: NotificationHolder, notificationToReturn: Notification) { + whenever(wearNotifications.buildStackedNotification(account, notificationHolder)) + .thenReturn(notificationToReturn) + } -private fun whenAddingContentReturn(content: NotificationContent, result: AddNotificationResult) { - val notificationData = newMailNotifications.notificationData - val newCount = notificationData.newMessagesCount + 1 - stubbing(notificationData) { - on { addNotificationContent(content) } doReturn result - on { newMessagesCount } doReturn newCount + private fun whenAddingContentReturn(content: NotificationContent, result: AddNotificationResult) { + val notificationData = newMailNotifications.notificationData + val newCount = notificationData.newMessagesCount + 1 + stubbing(notificationData) { + on { addNotificationContent(content) } doReturn result + on { newMessagesCount } doReturn newCount + } } -} -private fun whenRemovingContentReturn(messageReference: MessageReference, result: RemoveNotificationResult) { - stubbing(newMailNotifications.notificationData) { - on { removeNotificationForMessage(messageReference) } doReturn result + private fun whenRemovingContentReturn(messageReference: MessageReference, result: RemoveNotificationResult) { + stubbing(newMailNotifications.notificationData) { + on { removeNotificationForMessage(messageReference) } doReturn result + } } -} -private fun setActiveNotificationIds(vararg notificationIds: Int) { - stubbing(newMailNotifications.notificationData) { - on { getActiveNotificationIds() } doReturn notificationIds + private fun setActiveNotificationIds(vararg notificationIds: Int) { + stubbing(newMailNotifications.notificationData) { + on { getActiveNotificationIds() } doReturn notificationIds + } } -} -internal class TestNewMailNotifications( - notificationHelper: NotificationHelper, - contentCreator: NotificationContentCreator, - messageSummaryNotifications: MessageSummaryNotifications, - singleMessageNotifications: SingleMessageNotifications -) : NewMailNotifications( - notificationHelper, contentCreator, messageSummaryNotifications, singleMessageNotifications -) { - val notificationData = mock() - override fun createNotificationData(account: Account, unreadMessageCount: Int): NotificationData { - return notificationData + internal class TestNewMailNotifications( + notificationHelper: NotificationHelper, + contentCreator: NotificationContentCreator, + messageSummaryNotifications: MessageSummaryNotifications, + singleMessageNotifications: SingleMessageNotifications + ) : NewMailNotifications( + notificationHelper, contentCreator, messageSummaryNotifications, singleMessageNotifications + ) { + val notificationData = mock() + override fun createNotificationData(account: Account, unreadMessageCount: Int): NotificationData { + return notificationData + } } } -} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index 5d5e51f81b..dd334d0125 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -390,7 +390,6 @@ open class MessageList : noThreading = launchData.noThreading messageReference = launchData.messageReference - return true } @@ -1165,7 +1164,6 @@ open class MessageList : } } - fun setActionBarTitle(title: String, subtitle: String? = null) { actionBar.title = title actionBar.subtitle = subtitle diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt index d539e021d7..99e4d8e7d1 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientMvpView.kt @@ -214,7 +214,6 @@ class RecipientMvpView(private val activity: MessageCompose) : View.OnFocusChang fun setRecipientExpanderVisibility(visible: Boolean) { val childToDisplay = if (visible) VIEW_INDEX_BCC_EXPANDER_VISIBLE else VIEW_INDEX_BCC_EXPANDER_HIDDEN - if (recipientExpanderContainer.displayedChild != childToDisplay) { recipientExpanderContainer.displayedChild = childToDisplay } @@ -399,7 +398,6 @@ class RecipientMvpView(private val activity: MessageCompose) : View.OnFocusChang ERROR(R.id.crypto_status_error); } - enum class CryptoSpecialModeDisplayType(val childIdToDisplay: Int) { NONE(VIEW_INDEX_HIDDEN), PGP_INLINE(R.id.crypto_special_inline), diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt index 7cffd00c61..909c2017a7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt @@ -256,7 +256,6 @@ class RecipientPresenter( this.alwaysBccAddresses = alwaysBccAddresses if (alwaysBccAddresses.isEmpty()) return - object : RecipientLoader(context, account.openPgpProvider, *alwaysBccAddresses) { override fun deliverResult(result: List?) { val recipientArray = result!!.toTypedArray() @@ -564,7 +563,6 @@ class RecipientPresenter( return } - if (currentCryptoMode == CryptoMode.SIGN_ONLY) { recipientMvpView.showErrorIsSignOnly() return @@ -584,7 +582,7 @@ class RecipientPresenter( } else { onCryptoModeChanged(CryptoMode.CHOICE_ENABLED) if (showGotIt) { - recipientMvpView.showOpenPgpEncryptExplanationDialog(); + recipientMvpView.showOpenPgpEncryptExplanationDialog() recipientMvpView.showOpenPgpEncryptExplanationDialog() } } @@ -692,8 +690,6 @@ class RecipientPresenter( return true } - - return false } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt index 63099f0995..983ceecce7 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToPresenter.kt @@ -5,7 +5,6 @@ import com.fsck.k9.Identity import com.fsck.k9.mail.Address import com.fsck.k9.mail.Message - private const val STATE_KEY_REPLY_TO_SHOWN = "com.fsck.k9.activity.compose.ReplyToPresenter.replyToShown" class ReplyToPresenter(private val view: ReplyToView) { @@ -20,7 +19,6 @@ class ReplyToPresenter(private val view: ReplyToView) { } } - fun getAddresses(): Array
{ return view.getAddresses() } diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToView.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToView.kt index 2ddb9402d4..76297080e5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToView.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ReplyToView.kt @@ -122,4 +122,4 @@ class ReplyToView(activity: MessageCompose) : View.OnClickListener { replyToView.addTextChangedListener(textWatcher) } } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/contacts/ContactLetterExtractor.kt b/app/ui/legacy/src/main/java/com/fsck/k9/contacts/ContactLetterExtractor.kt index 3d6e29b44b..3b387a678a 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/contacts/ContactLetterExtractor.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/contacts/ContactLetterExtractor.kt @@ -1,7 +1,6 @@ package com.fsck.k9.contacts import com.fsck.k9.mail.Address -import java.util.Locale class ContactLetterExtractor { fun extractContactLetter(address: Address): String { diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt index 631035cbf6..e336ed3628 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/K9Drawer.kt @@ -4,7 +4,6 @@ import android.annotation.SuppressLint import android.content.Context import android.content.res.ColorStateList import android.content.res.Resources -import android.graphics.PorterDuff import android.graphics.drawable.Drawable import android.net.Uri import android.os.Bundle @@ -18,7 +17,6 @@ import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.fsck.k9.Account import com.fsck.k9.K9 import com.fsck.k9.activity.MessageList -import com.fsck.k9.controller.MessageCounts import com.fsck.k9.controller.MessagingController import com.fsck.k9.controller.SimpleMessagingListener import com.fsck.k9.mailstore.DisplayFolder @@ -28,7 +26,9 @@ import com.fsck.k9.ui.account.AccountsViewModel import com.fsck.k9.ui.account.DisplayAccount import com.fsck.k9.ui.base.Theme import com.fsck.k9.ui.base.ThemeManager +import com.fsck.k9.ui.folders.DisplayUnifiedInbox import com.fsck.k9.ui.folders.FolderIconProvider +import com.fsck.k9.ui.folders.FolderList import com.fsck.k9.ui.folders.FolderNameFormatter import com.fsck.k9.ui.folders.FoldersViewModel import com.fsck.k9.ui.settings.SettingsActivity @@ -56,8 +56,6 @@ import org.koin.androidx.viewmodel.ext.android.viewModel import org.koin.core.component.KoinComponent import org.koin.core.component.inject import org.koin.core.parameter.parametersOf -import com.fsck.k9.ui.folders.FolderList -import com.fsck.k9.ui.folders.DisplayUnifiedInbox private const val UNREAD_SYMBOL = "\u2B24" private const val STARRED_SYMBOL = "\u2605" @@ -137,7 +135,6 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K } } - accountsViewModel.displayAccountsLiveData.observeNotNull(parent) { accounts -> setAccounts(accounts) } @@ -374,7 +371,7 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K folderList.unifiedInbox?.let { unifiedInbox -> val unifiedInboxItem = PrimaryDrawerItem().apply { - //THERE BEFORE iconRes = getResId(R.attr.iconUnifiedInbox) + // THERE BEFORE iconRes = getResId(R.attr.iconUnifiedInbox) iconRes = R.drawable.ic_inbox_multiple identifier = DRAWER_ID_UNIFIED_INBOX nameRes = R.string.integrated_inbox_title @@ -385,7 +382,6 @@ class K9Drawer(private val parent: MessageList, savedInstanceState: Bundle?) : K badgeText = text badgeStyle = folderBadgeStyle } - } sliderView.addItems(unifiedInboxItem) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/AccountImageLoader.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/AccountImageLoader.kt index 5097a21bad..1db03ec74d 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/AccountImageLoader.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/AccountImageLoader.kt @@ -34,4 +34,4 @@ class AccountImageLoader(private val accountFallbackImageProvider: AccountFallba block(this) } } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/DisplayAccount.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/DisplayAccount.kt index 982a5af3f8..ef0e30b9d5 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/DisplayAccount.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/account/DisplayAccount.kt @@ -1,10 +1,9 @@ package com.fsck.k9.ui.account import com.fsck.k9.Account -import com.fsck.k9.controller.MessageCounts data class DisplayAccount( val account: Account, val unreadMessageCount: Int, val starredMessageCount: Int -) \ No newline at end of file +) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt index 2007ba05c9..7b1d1a49c8 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/choosefolder/ChooseFolderViewModel.kt @@ -35,4 +35,4 @@ class ChooseFolderViewModel(private val folderRepository: FolderRepository) : Vi } } -private data class DisplayMode(val account: Account, val displayMode: FolderMode) \ No newline at end of file +private data class DisplayMode(val account: Account, val displayMode: FolderMode) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/FoldersViewModel.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/FoldersViewModel.kt index 7a42b42da6..87e9256dda 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/FoldersViewModel.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/FoldersViewModel.kt @@ -1,25 +1,24 @@ package com.fsck.k9.ui.folders import androidx.lifecycle.LiveData -import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.ViewModel -import com.fsck.k9.Account -import com.fsck.k9.mailstore.DisplayFolder import androidx.lifecycle.asLiveData import androidx.lifecycle.viewModelScope +import com.fsck.k9.Account +import com.fsck.k9.K9 +import com.fsck.k9.controller.MessageCountsProvider +import com.fsck.k9.mailstore.DisplayFolder import com.fsck.k9.mailstore.FolderRepository +import com.fsck.k9.search.SearchAccount +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.flatMapLatest import kotlinx.coroutines.flow.flowOf -import kotlinx.coroutines.launch import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.map -import com.fsck.k9.search.SearchAccount -import kotlinx.coroutines.CoroutineDispatcher -import kotlinx.coroutines.Dispatchers -import com.fsck.k9.K9 -import com.fsck.k9.controller.MessageCountsProvider +import kotlinx.coroutines.launch @OptIn(ExperimentalCoroutinesApi::class) class FoldersViewModel( @@ -73,4 +72,4 @@ data class FolderList( data class DisplayUnifiedInbox( val unreadMessageCount: Int, val starredMessageCount: Int -) \ No newline at end of file +) diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/KoinModule.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/KoinModule.kt index c7f6e029d3..083b6c8274 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/KoinModule.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/folders/KoinModule.kt @@ -8,4 +8,4 @@ val foldersUiModule = module { single { FolderNameFormatterFactory() } factory { (context: Context) -> FolderNameFormatter(context.resources) } viewModel { FoldersViewModel(folderRepository = get(), messageCountsProvider = get()) } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt index de96ac027a..4775b493a9 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/FolderSettingsDataStore.kt @@ -1,13 +1,13 @@ package com.fsck.k9.ui.managefolders import androidx.preference.PreferenceDataStore +import com.fsck.k9.Account import com.fsck.k9.mail.FolderClass import com.fsck.k9.mailstore.FolderDetails import com.fsck.k9.mailstore.FolderRepository import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope -import com.fsck.k9.Account import kotlinx.coroutines.launch class FolderSettingsDataStore( diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt index 4c898ef8be..8b0d310cd2 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/managefolders/ManageFoldersViewModel.kt @@ -11,4 +11,4 @@ class ManageFoldersViewModel(private val folderRepository: FolderRepository) : V fun getFolders(account: Account): LiveData> { return folderRepository.getDisplayFoldersFlow(account).asLiveData() } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt index 35363db140..6721ba79ac 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsFragment.kt @@ -409,4 +409,4 @@ class AccountSettingsFragment : PreferenceFragmentCompat(), ConfirmationDialogFr PreferenceFragmentCompat.ARG_PREFERENCE_ROOT to rootKey ) } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt index 686963267b..8214b2615e 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsViewModel.kt @@ -71,7 +71,6 @@ class AccountSettingsViewModel( } } - private fun getAutomaticSpecialFolders(folders: List): Map { return mapOf( FolderType.ARCHIVE to specialFolderSelectionStrategy.selectSpecialFolder(folders, FolderType.ARCHIVE), diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.kt b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.kt index 68269f6412..4e157fd63c 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.kt @@ -1,4 +1,4 @@ -package com.fsck.k9.view; +package com.fsck.k9.view import androidx.annotation.AttrRes import androidx.annotation.DrawableRes @@ -322,4 +322,4 @@ enum class MessageCryptoDisplayStatus( } } } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt index a6fbaa8b9b..6d9400cec3 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/RecipientPresenterTest.kt @@ -278,7 +278,6 @@ class RecipientPresenterTest : K9RobolectricTest() { assertThat(Robolectric.getBackgroundThreadScheduler().runOneTask()).isTrue() } - private fun setupCryptoProvider(autocryptStatusResult: RecipientAutocryptStatus) { stubbing(account) { on { openPgpProvider } doReturn CRYPTO_PROVIDER diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt index 2dec377f39..ae60ab5020 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/activity/compose/ReplyToPresenterTest.kt @@ -4,10 +4,8 @@ import android.os.Bundle import com.fsck.k9.Identity import com.fsck.k9.K9RobolectricTest import com.fsck.k9.mail.Address - import com.google.common.truth.Truth.assertThat import org.junit.Test - import org.mockito.kotlin.doReturn import org.mockito.kotlin.mock import org.mockito.kotlin.never @@ -119,7 +117,6 @@ class ReplyToPresenterTest : K9RobolectricTest() { on { isVisible } doReturn false } - replyToPresenter.onNonRecipientFieldFocused() verify(view, never()).isVisible = false @@ -134,4 +131,4 @@ class ReplyToPresenterTest : K9RobolectricTest() { replyToPresenter.onNonRecipientFieldFocused() verify(view, never()).isVisible = false } -} \ No newline at end of file +} diff --git a/app/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt b/app/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt index b0f96c5dae..3e05048bb0 100644 --- a/app/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt +++ b/app/ui/legacy/src/test/java/com/fsck/k9/message/PgpMessageBuilderTest.kt @@ -46,11 +46,11 @@ import org.mockito.ArgumentMatchers.any import org.mockito.ArgumentMatchers.anyInt import org.mockito.ArgumentMatchers.eq import org.mockito.ArgumentMatchers.same -import org.mockito.Mockito.`when` import org.mockito.Mockito.mock import org.mockito.Mockito.spy import org.mockito.Mockito.verify import org.mockito.Mockito.verifyNoMoreInteractions +import org.mockito.Mockito.`when` import org.mockito.kotlin.anyOrNull import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderState import org.openintents.openpgp.OpenPgpError diff --git a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapBackendPusher.kt b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapBackendPusher.kt index e5c664041f..96c68da54e 100644 --- a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapBackendPusher.kt +++ b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapBackendPusher.kt @@ -249,4 +249,4 @@ internal class ImapBackendPusher( updateFolders() } -} \ No newline at end of file +} diff --git a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapFolderPusher.kt b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapFolderPusher.kt index 75aa2ed86a..d26296d027 100644 --- a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapFolderPusher.kt +++ b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapFolderPusher.kt @@ -51,7 +51,6 @@ class ImapFolderPusher( folderIdler?.stop() } - private fun runPushLoop() { val wakeLock = powerManager.newWakeLock("ImapFolderPusher-$accountName-$folderServerId") wakeLock.acquire() @@ -98,4 +97,4 @@ class ImapFolderPusher( private fun performInitialSync() { callback.onPushEvent(folderServerId) } -} \ No newline at end of file +} diff --git a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapPusherCallback.kt b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapPusherCallback.kt index 76f5ecac98..642668e62c 100644 --- a/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapPusherCallback.kt +++ b/backend/imap/src/main/java/com/fsck/k9/backend/imap/ImapPusherCallback.kt @@ -4,4 +4,4 @@ interface ImapPusherCallback { fun onPushEvent(folderServerId: String) fun onPushError(folderServerId: String, exception: Exception) fun onPushNotSupported() -} \ No newline at end of file +} diff --git a/build.gradle b/build.gradle index 5a48090a36..cbd493fab0 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ buildscript { 'mockitoKotlin': '3.1.0', 'truth': '1.1.2', - 'ktlint': '0.40.0' + 'ktlint': '0.43.2' ] javaVersion = JavaVersion.VERSION_1_8 @@ -65,7 +65,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}" - classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0" + classpath "org.jlleitschuh.gradle:ktlint-gradle:10.2.0" } } diff --git a/mail/common/src/main/java/com/fsck/k9/mail/MimeType.kt b/mail/common/src/main/java/com/fsck/k9/mail/MimeType.kt index 4d02bdcf12..33122ad0f6 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/MimeType.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/MimeType.kt @@ -1,7 +1,5 @@ package com.fsck.k9.mail -import java.util.Locale - class MimeType private constructor( val type: String, val subtype: String diff --git a/mail/common/src/main/java/com/fsck/k9/mail/ServerSettings.kt b/mail/common/src/main/java/com/fsck/k9/mail/ServerSettings.kt index 893699e906..d73a2aadaf 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/ServerSettings.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/ServerSettings.kt @@ -1,7 +1,5 @@ package com.fsck.k9.mail -import java.util.Locale - /** * Container for incoming or outgoing server settings */ diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/FormatFlowedHelper.kt b/mail/common/src/main/java/com/fsck/k9/mail/internet/FormatFlowedHelper.kt index 6ebe5c4c99..65efd9c394 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/FormatFlowedHelper.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/FormatFlowedHelper.kt @@ -1,7 +1,5 @@ package com.fsck.k9.mail.internet -import java.util.Locale - internal object FormatFlowedHelper { private const val TEXT_PLAIN = "text/plain" private const val HEADER_PARAM_FORMAT = "format" @@ -21,7 +19,6 @@ internal object FormatFlowedHelper { val delSpParameter = mimeValue.parameters[HEADER_PARAM_DELSP]?.lowercase() - return FormatFlowedResult(isFormatFlowed = true, isDelSp = delSpParameter == HEADER_DELSP_YES) } diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageIdGenerator.kt b/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageIdGenerator.kt index a365ee2d4c..286a6431fd 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageIdGenerator.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MessageIdGenerator.kt @@ -2,7 +2,6 @@ package com.fsck.k9.mail.internet import com.fsck.k9.mail.Address import com.fsck.k9.mail.Message -import java.util.Locale import java.util.UUID class MessageIdGenerator(private val uuidGenerator: UuidGenerator) { @@ -31,4 +30,4 @@ class K9UuidGenerator : UuidGenerator { // We use upper case here to match Apple Mail Message-ID format (for privacy) return UUID.randomUUID().toString().uppercase() } -} \ No newline at end of file +} diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeExtensions.kt b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeExtensions.kt index a0e58e3d4e..093a57cbfa 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeExtensions.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeExtensions.kt @@ -60,4 +60,3 @@ internal fun Char.isAText() = isALPHA() || isDIGIT() || this in ATEXT_SPECIAL // RFC 5322: Printable US-ASCII characters not including "[", "]", or "\" // dtext = %d33-90 / %d94-126 / obs-dtext internal fun Char.isDText() = code.let { it in 33..90 || it in 94..126 } - diff --git a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeParameterDecoder.kt b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeParameterDecoder.kt index be5c39845b..7dcf29a6d6 100644 --- a/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeParameterDecoder.kt +++ b/mail/common/src/main/java/com/fsck/k9/mail/internet/MimeParameterDecoder.kt @@ -2,7 +2,6 @@ package com.fsck.k9.mail.internet import java.nio.charset.Charset import java.nio.charset.IllegalCharsetNameException -import java.util.Locale import okio.Buffer private typealias Parameters = Map diff --git a/mail/common/src/test/java/com/fsck/k9/mail/internet/FormatFlowedHelperTest.kt b/mail/common/src/test/java/com/fsck/k9/mail/internet/FormatFlowedHelperTest.kt index 7099e534bd..145292db7d 100644 --- a/mail/common/src/test/java/com/fsck/k9/mail/internet/FormatFlowedHelperTest.kt +++ b/mail/common/src/test/java/com/fsck/k9/mail/internet/FormatFlowedHelperTest.kt @@ -55,4 +55,3 @@ class FormatFlowedHelperTest { assertThat(result.isDelSp).isFalse() } } - -- GitLab