Loading app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 = Loading app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt +14 −14 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) Loading Loading @@ -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( Loading Loading @@ -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) Loading app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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( Loading app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt +9 −0 Original line number Diff line number Diff line Loading @@ -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) } Loading Loading
app/core/src/main/java/com/fsck/k9/mailstore/FolderRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -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 = Loading
app/core/src/main/java/com/fsck/k9/mailstore/LocalMessage.java +1 −1 Original line number Diff line number Diff line Loading @@ -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; Loading
app/core/src/main/java/com/fsck/k9/notification/DeviceNotifications.kt +14 −14 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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) Loading Loading @@ -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( Loading Loading @@ -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) Loading
app/core/src/main/java/com/fsck/k9/notification/NotificationActionCreator.kt +2 −0 Original line number Diff line number Diff line Loading @@ -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( Loading
app/core/src/main/java/com/fsck/k9/notification/NotificationActionService.kt +9 −0 Original line number Diff line number Diff line Loading @@ -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) } Loading