From 1539396f171770287330a5d6f2514c1e5d7f7aab Mon Sep 17 00:00:00 2001 From: Su TT Date: Sat, 9 Aug 2025 14:48:18 -0400 Subject: [PATCH 1/7] feat(notification): Add brand-specific push notification icons Introduces NotificationIconResourceProvider to allow different app flavors to supply their own push notification icon. This change includes: - The NotificationIconResourceProvider interface. - Implementations for K-9 Mail and Thunderbird. - A new PushIconTestNotification in the debug settings to verify the provider. - Removal of the old manual DebugNotificationActivity. Fixes #8932 --- app-k9mail/src/debug/AndroidManifest.xml | 3 ++ .../provider/K9AppNotificationIconProvider.kt | 10 +++++ .../app/k9mail/provider/ProviderModule.kt | 5 +++ .../K9AppNotificationIconProviderTest.kt | 17 ++++++++ app-thunderbird/badging/fossBeta-badging.txt | 16 ++++---- app-thunderbird/badging/fossDaily-badging.txt | 16 ++++---- app-thunderbird/badging/fullBeta-badging.txt | 16 ++++---- app-thunderbird/badging/fullDaily-badging.txt | 16 ++++---- app-thunderbird/src/main/AndroidManifest.xml | 2 +- .../android/ThunderbirdKoinModule.kt | 1 - .../android/provider/ProviderModule.kt | 5 +++ .../provider/TbAppIconNotificationProvider.kt | 8 ++++ .../TbAppIconNotificationProviderTest.kt | 17 ++++++++ .../NotificationIconResourceProvider.kt | 5 +++ .../main/res/drawable/ic_logo_k9_white.xml | 41 +++++++++++++++++++ .../drawable/ic_logo_thunderbird_white.xml | 21 ++++++++++ feature/debug-settings/build.gradle.kts | 1 + .../SecretDebugSettingsScreenPreview.kt | 7 ++++ .../inject/FeatureDebugSettingsModule.kt | 1 + .../DebugNotificationSectionViewModel.kt | 8 ++++ .../notification/PushIconTestNotification.kt | 17 ++++++++ .../widget/unread/FakeCoreResourceProvider.kt | 3 -- gradle/libs.versions.toml | 6 ++- .../k9/resources/K9CoreResourceProvider.kt | 3 -- .../java/com/fsck/k9/resources/KoinModule.kt | 1 + legacy/core/build.gradle.kts | 2 +- .../java/com/fsck/k9/CoreResourceProvider.kt | 1 + .../CoreNotificationKoinModule.kt | 3 ++ .../notification/PushNotificationManager.kt | 5 ++- .../SyncNotificationController.kt | 7 ++-- .../com/fsck/k9/TestCoreResourceProvider.kt | 3 -- .../SyncNotificationControllerTest.kt | 9 +++- .../TestNotificationIconResourceProvider.kt | 7 ++++ .../com/fsck/k9/TestCoreResourceProvider.kt | 3 -- 34 files changed, 230 insertions(+), 56 deletions(-) create mode 100644 app-k9mail/src/main/kotlin/app/k9mail/provider/K9AppNotificationIconProvider.kt create mode 100644 app-k9mail/src/test/kotlin/app/k9mail/K9AppNotificationIconProviderTest.kt create mode 100644 app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/TbAppIconNotificationProvider.kt create mode 100644 app-thunderbird/src/test/kotlin/net/thunderbird/android/TbAppIconNotificationProviderTest.kt create mode 100644 core/android/common/src/main/kotlin/app/k9mail/core/android/common/provider/NotificationIconResourceProvider.kt create mode 100644 core/ui/legacy/theme2/k9mail/src/main/res/drawable/ic_logo_k9_white.xml create mode 100644 core/ui/legacy/theme2/thunderbird/src/main/res/drawable/ic_logo_thunderbird_white.xml create mode 100644 feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt create mode 100644 legacy/core/src/test/java/com/fsck/k9/notification/TestNotificationIconResourceProvider.kt diff --git a/app-k9mail/src/debug/AndroidManifest.xml b/app-k9mail/src/debug/AndroidManifest.xml index 689e9c615a4..9b026cae36a 100644 --- a/app-k9mail/src/debug/AndroidManifest.xml +++ b/app-k9mail/src/debug/AndroidManifest.xml @@ -24,4 +24,7 @@ + + + diff --git a/app-k9mail/src/main/kotlin/app/k9mail/provider/K9AppNotificationIconProvider.kt b/app-k9mail/src/main/kotlin/app/k9mail/provider/K9AppNotificationIconProvider.kt new file mode 100644 index 00000000000..6d53a01af18 --- /dev/null +++ b/app-k9mail/src/main/kotlin/app/k9mail/provider/K9AppNotificationIconProvider.kt @@ -0,0 +1,10 @@ +package app.k9mail.provider + +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider +import app.k9mail.core.ui.legacy.theme2.k9mail.R + +class K9AppNotificationIconProvider : NotificationIconResourceProvider { + override val pushNotificationIcon: Int + + get() = R.drawable.ic_logo_k9_white +} diff --git a/app-k9mail/src/main/kotlin/app/k9mail/provider/ProviderModule.kt b/app-k9mail/src/main/kotlin/app/k9mail/provider/ProviderModule.kt index 07e236989f7..303aca7908b 100644 --- a/app-k9mail/src/main/kotlin/app/k9mail/provider/ProviderModule.kt +++ b/app-k9mail/src/main/kotlin/app/k9mail/provider/ProviderModule.kt @@ -1,5 +1,6 @@ package app.k9mail.provider +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import com.fsck.k9.preferences.FilePrefixProvider import net.thunderbird.core.common.provider.AppNameProvider import net.thunderbird.core.common.provider.BrandNameProvider @@ -17,4 +18,8 @@ internal val providerModule = module { single { K9ThemeProvider() } single { K9FeatureThemeProvider() } + + single { + K9AppNotificationIconProvider() + } } diff --git a/app-k9mail/src/test/kotlin/app/k9mail/K9AppNotificationIconProviderTest.kt b/app-k9mail/src/test/kotlin/app/k9mail/K9AppNotificationIconProviderTest.kt new file mode 100644 index 00000000000..ab59d1077bb --- /dev/null +++ b/app-k9mail/src/test/kotlin/app/k9mail/K9AppNotificationIconProviderTest.kt @@ -0,0 +1,17 @@ +package app.k9mail + +import app.k9mail.provider.K9AppNotificationIconProvider +import assertk.assertThat +import assertk.assertions.isEqualTo +import kotlin.test.Test + +class K9AppNotificationIconProviderTest { + @Test + fun `provides correct K9 notification icon`() { + val provider = K9AppNotificationIconProvider() + val icon = provider.pushNotificationIcon + + assertThat(icon) + .isEqualTo(app.k9mail.core.ui.legacy.theme2.k9mail.R.drawable.ic_logo_k9_white) + } +} diff --git a/app-thunderbird/badging/fossBeta-badging.txt b/app-thunderbird/badging/fossBeta-badging.txt index 3bd2f8bf53a..f3b7594cc18 100644 --- a/app-thunderbird/badging/fossBeta-badging.txt +++ b/app-thunderbird/badging/fossBeta-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-120:'res/drawable/ic_app_logo.xml' +application-icon-160:'res/drawable/ic_app_logo.xml' +application-icon-240:'res/drawable/ic_app_logo.xml' +application-icon-320:'res/drawable/ic_app_logo.xml' +application-icon-480:'res/drawable/ic_app_logo.xml' +application-icon-640:'res/drawable/ic_app_logo.xml' +application-icon-65534:'res/drawable/ic_app_logo.xml' application-label-ar:'Thunderbird Beta' application-label-be:'Thunderbird Beta' application-label-bg:'Thunderbird Beta' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Beta' application-label-zh-TW:'Thunderbird Beta' application-label-zh:'Thunderbird Beta' application-label:'Thunderbird Beta' -application: label='Thunderbird Beta' icon='res/mipmap-anydpi-v26/ic_launcher.xml' +application: label='Thunderbird Beta' icon='res/drawable/ic_app_logo.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' diff --git a/app-thunderbird/badging/fossDaily-badging.txt b/app-thunderbird/badging/fossDaily-badging.txt index e55ca6989f4..5d690d439fc 100644 --- a/app-thunderbird/badging/fossDaily-badging.txt +++ b/app-thunderbird/badging/fossDaily-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-120:'res/drawable/ic_app_logo.xml' +application-icon-160:'res/drawable/ic_app_logo.xml' +application-icon-240:'res/drawable/ic_app_logo.xml' +application-icon-320:'res/drawable/ic_app_logo.xml' +application-icon-480:'res/drawable/ic_app_logo.xml' +application-icon-640:'res/drawable/ic_app_logo.xml' +application-icon-65534:'res/drawable/ic_app_logo.xml' application-label-ar:'Thunderbird Daily' application-label-be:'Thunderbird Daily' application-label-bg:'Thunderbird Daily' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Daily' application-label-zh-TW:'Thunderbird Daily' application-label-zh:'Thunderbird Daily' application-label:'Thunderbird Daily' -application: label='Thunderbird Daily' icon='res/mipmap-anydpi-v26/ic_launcher.xml' +application: label='Thunderbird Daily' icon='res/drawable/ic_app_logo.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' diff --git a/app-thunderbird/badging/fullBeta-badging.txt b/app-thunderbird/badging/fullBeta-badging.txt index 1e4a87bcac8..1386af2d372 100644 --- a/app-thunderbird/badging/fullBeta-badging.txt +++ b/app-thunderbird/badging/fullBeta-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-120:'res/drawable/ic_app_logo.xml' +application-icon-160:'res/drawable/ic_app_logo.xml' +application-icon-240:'res/drawable/ic_app_logo.xml' +application-icon-320:'res/drawable/ic_app_logo.xml' +application-icon-480:'res/drawable/ic_app_logo.xml' +application-icon-640:'res/drawable/ic_app_logo.xml' +application-icon-65534:'res/drawable/ic_app_logo.xml' application-label-ar:'Thunderbird Beta' application-label-be:'Thunderbird Beta' application-label-bg:'Thunderbird Beta' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Beta' application-label-zh-TW:'Thunderbird Beta' application-label-zh:'Thunderbird Beta' application-label:'Thunderbird Beta' -application: label='Thunderbird Beta' icon='res/mipmap-anydpi-v26/ic_launcher.xml' +application: label='Thunderbird Beta' icon='res/drawable/ic_app_logo.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' diff --git a/app-thunderbird/badging/fullDaily-badging.txt b/app-thunderbird/badging/fullDaily-badging.txt index ed9d025abd2..e3d6d486e02 100644 --- a/app-thunderbird/badging/fullDaily-badging.txt +++ b/app-thunderbird/badging/fullDaily-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' -application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-120:'res/drawable/ic_app_logo.xml' +application-icon-160:'res/drawable/ic_app_logo.xml' +application-icon-240:'res/drawable/ic_app_logo.xml' +application-icon-320:'res/drawable/ic_app_logo.xml' +application-icon-480:'res/drawable/ic_app_logo.xml' +application-icon-640:'res/drawable/ic_app_logo.xml' +application-icon-65534:'res/drawable/ic_app_logo.xml' application-label-ar:'Thunderbird Daily' application-label-be:'Thunderbird Daily' application-label-bg:'Thunderbird Daily' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Daily' application-label-zh-TW:'Thunderbird Daily' application-label-zh:'Thunderbird Daily' application-label:'Thunderbird Daily' -application: label='Thunderbird Daily' icon='res/mipmap-anydpi-v26/ic_launcher.xml' +application: label='Thunderbird Daily' icon='res/drawable/ic_app_logo.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' diff --git a/app-thunderbird/src/main/AndroidManifest.xml b/app-thunderbird/src/main/AndroidManifest.xml index 780fcb614c6..5405ae49f09 100644 --- a/app-thunderbird/src/main/AndroidManifest.xml +++ b/app-thunderbird/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ diff --git a/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt b/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt index c8dc26e9088..6930fc13167 100644 --- a/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt +++ b/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt @@ -1,5 +1,4 @@ package net.thunderbird.android - import app.k9mail.feature.widget.shortcut.LauncherShortcutActivity import com.fsck.k9.AppConfig import com.fsck.k9.DefaultAppConfig diff --git a/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/ProviderModule.kt b/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/ProviderModule.kt index cf7d989eefd..cd46613fe83 100644 --- a/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/ProviderModule.kt +++ b/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/ProviderModule.kt @@ -1,5 +1,6 @@ package net.thunderbird.android.provider +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import com.fsck.k9.preferences.FilePrefixProvider import net.thunderbird.core.common.provider.AppNameProvider import net.thunderbird.core.common.provider.BrandNameProvider @@ -17,4 +18,8 @@ internal val providerModule = module { single { TbThemeProvider() } single { TbFeatureThemeProvider() } + + single { + TbAppIconNotificationProvider() + } } diff --git a/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/TbAppIconNotificationProvider.kt b/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/TbAppIconNotificationProvider.kt new file mode 100644 index 00000000000..6cbaba6179e --- /dev/null +++ b/app-thunderbird/src/main/kotlin/net/thunderbird/android/provider/TbAppIconNotificationProvider.kt @@ -0,0 +1,8 @@ +package net.thunderbird.android.provider + +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider + +class TbAppIconNotificationProvider : NotificationIconResourceProvider { + override val pushNotificationIcon: Int + get() = app.k9mail.core.ui.legacy.theme2.thunderbird.R.drawable.ic_logo_thunderbird_white +} diff --git a/app-thunderbird/src/test/kotlin/net/thunderbird/android/TbAppIconNotificationProviderTest.kt b/app-thunderbird/src/test/kotlin/net/thunderbird/android/TbAppIconNotificationProviderTest.kt new file mode 100644 index 00000000000..86dd8c284d0 --- /dev/null +++ b/app-thunderbird/src/test/kotlin/net/thunderbird/android/TbAppIconNotificationProviderTest.kt @@ -0,0 +1,17 @@ +package net.thunderbird.android + +import assertk.assertThat +import assertk.assertions.isEqualTo +import net.thunderbird.android.provider.TbAppIconNotificationProvider +import org.junit.Test + +class TbAppIconNotificationProviderTest { + @Test + fun `provides correct Thunderbird notification icon`() { + val provider = TbAppIconNotificationProvider() + val icon = provider.pushNotificationIcon + + assertThat(icon) + .isEqualTo(app.k9mail.core.ui.legacy.theme2.thunderbird.R.drawable.ic_logo_thunderbird_white) + } +} diff --git a/core/android/common/src/main/kotlin/app/k9mail/core/android/common/provider/NotificationIconResourceProvider.kt b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/provider/NotificationIconResourceProvider.kt new file mode 100644 index 00000000000..014283ae9f0 --- /dev/null +++ b/core/android/common/src/main/kotlin/app/k9mail/core/android/common/provider/NotificationIconResourceProvider.kt @@ -0,0 +1,5 @@ +package app.k9mail.core.android.common.provider + +interface NotificationIconResourceProvider { + val pushNotificationIcon: Int +} diff --git a/core/ui/legacy/theme2/k9mail/src/main/res/drawable/ic_logo_k9_white.xml b/core/ui/legacy/theme2/k9mail/src/main/res/drawable/ic_logo_k9_white.xml new file mode 100644 index 00000000000..a1f0d0b8a8b --- /dev/null +++ b/core/ui/legacy/theme2/k9mail/src/main/res/drawable/ic_logo_k9_white.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/ui/legacy/theme2/thunderbird/src/main/res/drawable/ic_logo_thunderbird_white.xml b/core/ui/legacy/theme2/thunderbird/src/main/res/drawable/ic_logo_thunderbird_white.xml new file mode 100644 index 00000000000..a2efb445b2a --- /dev/null +++ b/core/ui/legacy/theme2/thunderbird/src/main/res/drawable/ic_logo_thunderbird_white.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/feature/debug-settings/build.gradle.kts b/feature/debug-settings/build.gradle.kts index 98331635e44..cb84a11f9de 100644 --- a/feature/debug-settings/build.gradle.kts +++ b/feature/debug-settings/build.gradle.kts @@ -16,4 +16,5 @@ dependencies { implementation(projects.core.outcome) implementation(projects.feature.mail.account.api) implementation(projects.feature.notification.api) + implementation(projects.core.android.common) } diff --git a/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/SecretDebugSettingsScreenPreview.kt b/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/SecretDebugSettingsScreenPreview.kt index 9daad49e3c3..4ed66462d57 100644 --- a/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/SecretDebugSettingsScreenPreview.kt +++ b/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/SecretDebugSettingsScreenPreview.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.PreviewLightDark +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import app.k9mail.core.ui.compose.common.koin.koinPreview import app.k9mail.core.ui.compose.designsystem.PreviewWithThemesLightDark import kotlinx.coroutines.flow.Flow @@ -29,6 +30,11 @@ private fun SecretDebugSettingsScreenPreview() { override val notifications: StateFlow> = MutableStateFlow(emptySet()) } } + single { + object : NotificationIconResourceProvider { + override val pushNotificationIcon: Int = 0 + } + } single { DebugNotificationSectionViewModel( stringsResourceManager = object : StringsResourceManager { @@ -55,6 +61,7 @@ private fun SecretDebugSettingsScreenPreview() { error("not implemented") }, inAppNotificationStream = get(), + notificationIconResourceProvider = get(), ) } } WithContent { diff --git a/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/inject/FeatureDebugSettingsModule.kt b/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/inject/FeatureDebugSettingsModule.kt index 3677255c6f2..67e177a19d3 100644 --- a/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/inject/FeatureDebugSettingsModule.kt +++ b/feature/debug-settings/src/debug/kotlin/net/thunderbird/feature/debug/settings/inject/FeatureDebugSettingsModule.kt @@ -14,6 +14,7 @@ val featureDebugSettingsModule = module { accountManager = get(), notificationSender = get(), inAppNotificationStream = get(), + notificationIconResourceProvider = get(), ) } } diff --git a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt index bad96c42c5f..7a6663eac4b 100644 --- a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt +++ b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt @@ -1,7 +1,9 @@ package net.thunderbird.feature.debug.settings.notification import androidx.lifecycle.viewModelScope +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import app.k9mail.core.ui.compose.common.mvi.BaseViewModel +import kotlin.jvm.java import kotlin.reflect.KClass import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf @@ -37,6 +39,7 @@ internal class DebugNotificationSectionViewModel( private val accountManager: AccountManager, private val notificationSender: NotificationSender, private val inAppNotificationStream: InAppNotificationStream, + private val notificationIconResourceProvider: NotificationIconResourceProvider, private val mainDispatcher: CoroutineDispatcher = Dispatchers.Main, ioDispatcher: CoroutineDispatcher = Dispatchers.IO, ) : BaseViewModel(initialState = State()), DebugNotificationSectionContract.ViewModel { @@ -60,6 +63,7 @@ internal class DebugNotificationSectionViewModel( add(PushServiceNotification.Listening::class) add(PushServiceNotification.WaitBackgroundSync::class) add(PushServiceNotification.WaitNetwork::class) + add(PushIconTestNotification::class) }.toPersistentList() val inAppNotificationTypes = buildList { @@ -281,6 +285,10 @@ internal class DebugNotificationSectionViewModel( PushServiceNotification.WaitNetwork::class -> PushServiceNotification.WaitNetwork() + PushIconTestNotification::class -> PushIconTestNotification( + pushIcon = notificationIconResourceProvider.pushNotificationIcon, + ) + else -> null } diff --git a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt new file mode 100644 index 00000000000..00cbdb4dfe1 --- /dev/null +++ b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt @@ -0,0 +1,17 @@ +package net.thunderbird.feature.debug.settings.notification + +import net.thunderbird.feature.notification.api.NotificationChannel +import net.thunderbird.feature.notification.api.NotificationSeverity +import net.thunderbird.feature.notification.api.content.AppNotification +import net.thunderbird.feature.notification.api.content.SystemNotification +import net.thunderbird.feature.notification.api.ui.icon.NotificationIcon + +class PushIconTestNotification( + pushIcon: Int, +) : AppNotification(), SystemNotification { + override val title: String = "Push Icon Test" + override val contentText: String = "Verifying NotificationIconResourceProvider" + override val severity: NotificationSeverity = NotificationSeverity.Information + override val channel: NotificationChannel = NotificationChannel.PushService + override val icon: NotificationIcon = NotificationIcon(systemNotificationIcon = pushIcon) +} diff --git a/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/FakeCoreResourceProvider.kt b/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/FakeCoreResourceProvider.kt index ff48f47e69e..1d54aeb30c6 100644 --- a/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/FakeCoreResourceProvider.kt +++ b/feature/widget/unread/src/test/kotlin/app/k9mail/feature/widget/unread/FakeCoreResourceProvider.kt @@ -64,9 +64,6 @@ class FakeCoreResourceProvider : CoreResourceProvider { throw UnsupportedOperationException("not implemented") } - override val iconPushNotification: Int - get() = throw UnsupportedOperationException("not implemented") - override fun pushNotificationText(notificationState: PushNotificationState): String { throw UnsupportedOperationException("not implemented") } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cdf4a18ea92..6accff8b547 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -164,8 +164,8 @@ androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" } androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidxConstraintLayout" } androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorlayout", version.ref = "androidxCoordinatorLayout" } -androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" } -androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } +androidx-core = { module = "androidx.core:core", version.ref = "androidxTestCore" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxTestCore" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" } androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidxDatastore" } androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidxDatastore" } @@ -194,6 +194,7 @@ androidx-preference = { module = "androidx.preference:preference", version.ref = androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerView" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidxSwiperefreshlayout" } androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } +androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" } androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" } androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } @@ -284,6 +285,7 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } xmlpull = { module = "com.github.cketti:xmlpull-extracted-from-android", version.ref = "xmlpull" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } + [bundles] shared-kmp-common = [ "koin-core", diff --git a/legacy/common/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt b/legacy/common/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt index 2cef5a35de3..b5e04f0489c 100644 --- a/legacy/common/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt +++ b/legacy/common/src/main/java/com/fsck/k9/resources/K9CoreResourceProvider.kt @@ -1,7 +1,6 @@ package com.fsck.k9.resources import android.content.Context -import app.k9mail.core.ui.legacy.designsystem.atom.icon.Icons import com.fsck.k9.CoreResourceProvider import com.fsck.k9.notification.PushNotificationState import com.fsck.k9.ui.R @@ -35,8 +34,6 @@ class K9CoreResourceProvider( override fun searchUnifiedFoldersTitle(): String = context.getString(R.string.integrated_inbox_title) override fun searchUnifiedFoldersDetail(): String = context.getString(R.string.integrated_inbox_detail) - override val iconPushNotification: Int = Icons.Outlined.Notifications - override fun pushNotificationText(notificationState: PushNotificationState): String { val resId = when (notificationState) { PushNotificationState.INITIALIZING -> R.string.push_notification_state_initializing diff --git a/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt b/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt index 60bd01ff447..6a35b72c893 100644 --- a/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt +++ b/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt @@ -5,6 +5,7 @@ import com.fsck.k9.autocrypt.AutocryptStringProvider import org.koin.dsl.module val resourcesModule = module { + single { K9CoreResourceProvider( context = get(), diff --git a/legacy/core/build.gradle.kts b/legacy/core/build.gradle.kts index 1cf0d9e981e..92c06fc4b7e 100644 --- a/legacy/core/build.gradle.kts +++ b/legacy/core/build.gradle.kts @@ -56,7 +56,7 @@ dependencies { testImplementation(projects.backend.imap) testImplementation(projects.mail.protocols.smtp) testImplementation(projects.legacy.storage) - + testImplementation(projects.core.android.common) testImplementation(libs.kotlin.test) testImplementation(libs.kotlin.reflect) testImplementation(libs.robolectric) diff --git a/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt b/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt index 179fcd9a62f..671908df61e 100644 --- a/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt +++ b/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt @@ -26,6 +26,7 @@ interface CoreResourceProvider { fun searchUnifiedFoldersDetail(): String val iconPushNotification: Int + fun pushNotificationText(notificationState: PushNotificationState): String fun pushNotificationInfoText(): String fun pushNotificationGrantAlarmPermissionText(): String diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt b/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt index a78feeeb0ee..6fad3e7bd28 100644 --- a/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt +++ b/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt @@ -5,6 +5,7 @@ import android.content.Context import androidx.core.app.NotificationManagerCompat import java.util.concurrent.Executors import kotlin.time.ExperimentalTime +import org.koin.core.scope.get import org.koin.dsl.module val coreNotificationModule = module { @@ -58,6 +59,7 @@ val coreNotificationModule = module { actionBuilder = get(), resourceProvider = get(), outboxFolderManager = get(), + iconResourceProvider = get(), ) } single { @@ -127,6 +129,7 @@ val coreNotificationModule = module { resourceProvider = get(), notificationChannelManager = get(), notificationManager = get(), + iconResourceProvider = get(), ) } single { diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/PushNotificationManager.kt b/legacy/core/src/main/java/com/fsck/k9/notification/PushNotificationManager.kt index 7fb2d19629e..78f43e08530 100644 --- a/legacy/core/src/main/java/com/fsck/k9/notification/PushNotificationManager.kt +++ b/legacy/core/src/main/java/com/fsck/k9/notification/PushNotificationManager.kt @@ -1,5 +1,4 @@ package com.fsck.k9.notification - import android.app.Notification import android.app.PendingIntent import android.content.Context @@ -10,6 +9,7 @@ import android.provider.Settings import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.app.PendingIntentCompat +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import com.fsck.k9.CoreResourceProvider private const val PUSH_INFO_ACTION = "app.k9mail.action.PUSH_INFO" @@ -17,6 +17,7 @@ private const val PUSH_INFO_ACTION = "app.k9mail.action.PUSH_INFO" internal class PushNotificationManager( private val context: Context, private val resourceProvider: CoreResourceProvider, + private val iconResourceProvider: NotificationIconResourceProvider, private val notificationChannelManager: NotificationChannelManager, private val notificationManager: NotificationManagerCompat, ) { @@ -53,7 +54,7 @@ internal class PushNotificationManager( private fun createNotification(): Notification { return NotificationCompat.Builder(context, notificationChannelManager.pushChannelId) - .setSmallIcon(resourceProvider.iconPushNotification) + .setSmallIcon(iconResourceProvider.pushNotificationIcon) .setContentTitle(resourceProvider.pushNotificationText(notificationState)) .setContentText(getContentText()) .setContentIntent(getContentIntent()) diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt b/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt index 8ff5835e8bb..b1292421d71 100644 --- a/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt +++ b/legacy/core/src/main/java/com/fsck/k9/notification/SyncNotificationController.kt @@ -3,6 +3,7 @@ package com.fsck.k9.notification import android.app.Notification import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import com.fsck.k9.mailstore.LocalFolder import net.thunderbird.core.android.account.LegacyAccountDto import net.thunderbird.feature.mail.folder.api.OutboxFolderManager @@ -12,6 +13,7 @@ internal class SyncNotificationController( private val actionBuilder: NotificationActionCreator, private val resourceProvider: NotificationResourceProvider, private val outboxFolderManager: OutboxFolderManager, + private val iconResourceProvider: NotificationIconResourceProvider, ) { fun showSendingNotification(account: LegacyAccountDto) { val accountName = account.displayName @@ -60,7 +62,7 @@ internal class SyncNotificationController( val notificationBuilder = notificationHelper .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS) - .setSmallIcon(resourceProvider.iconCheckingMail) + .setSmallIcon(iconResourceProvider.pushNotificationIcon) .setColor(account.chipColor) .setWhen(System.currentTimeMillis()) .setOngoing(true) @@ -70,7 +72,6 @@ internal class SyncNotificationController( .setContentIntent(showMessageListPendingIntent) .setPublicVersion(createFetchingMailLockScreenNotification(account)) .setCategory(NotificationCompat.CATEGORY_SERVICE) - notificationManager.notify(notificationId, notificationBuilder.build()) } @@ -81,7 +82,7 @@ internal class SyncNotificationController( val notificationBuilder = notificationHelper .createNotificationBuilder(account, NotificationChannelManager.ChannelType.MISCELLANEOUS) - .setSmallIcon(resourceProvider.iconCheckingMail) + .setSmallIcon(iconResourceProvider.pushNotificationIcon) .setColor(account.chipColor) .setWhen(System.currentTimeMillis()) .setOngoing(true) diff --git a/legacy/core/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt b/legacy/core/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt index e48895ac4db..652b607959f 100644 --- a/legacy/core/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt +++ b/legacy/core/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt @@ -26,9 +26,6 @@ class TestCoreResourceProvider : CoreResourceProvider { override fun searchUnifiedFoldersTitle() = "Unified Folders" override fun searchUnifiedFoldersDetail() = "All messages in unified folders" - override val iconPushNotification: Int - get() = throw UnsupportedOperationException("not implemented") - override fun pushNotificationText(notificationState: PushNotificationState): String { throw UnsupportedOperationException("not implemented") } diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt b/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt index 828052706bb..f8b253be558 100644 --- a/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt +++ b/legacy/core/src/test/java/com/fsck/k9/notification/SyncNotificationControllerTest.kt @@ -5,6 +5,7 @@ import android.app.PendingIntent import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.test.core.app.ApplicationProvider +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import com.fsck.k9.mailstore.LocalFolder import com.fsck.k9.notification.NotificationIds.getFetchingMailNotificationId import net.thunderbird.core.android.account.LegacyAccountDto @@ -25,9 +26,12 @@ private const val ACCOUNT_NUMBER = 1 private const val ACCOUNT_NAME = "TestAccount" private const val FOLDER_SERVER_ID = "INBOX" private const val FOLDER_NAME = "Inbox" +private const val TEST_ICON_ID = 0xCAFE class SyncNotificationControllerTest : RobolectricTest() { private val resourceProvider: NotificationResourceProvider = TestNotificationResourceProvider() + private val iconResourceProvider: NotificationIconResourceProvider = + TestNotificationIconResourceProvider(pushNotificationIcon = TEST_ICON_ID) private val notification = mock() private val lockScreenNotification = mock() private val notificationManager = mock() @@ -40,6 +44,7 @@ class SyncNotificationControllerTest : RobolectricTest() { actionBuilder = createActionBuilder(contentIntent), resourceProvider = resourceProvider, outboxFolderManager = FakeOutboxFolderManager(outboxFolderId = 33L), + iconResourceProvider = iconResourceProvider, ) @Test @@ -77,7 +82,7 @@ class SyncNotificationControllerTest : RobolectricTest() { controller.showFetchingMailNotification(account, localFolder) verify(notificationManager).notify(notificationId, notification) - verify(builder).setSmallIcon(resourceProvider.iconCheckingMail) + verify(builder).setSmallIcon(iconResourceProvider.pushNotificationIcon) verify(builder).setTicker("Checking mail: $ACCOUNT_NAME:$FOLDER_NAME") verify(builder).setContentTitle("Checking mail") verify(builder).setContentText("$ACCOUNT_NAME:$FOLDER_NAME") @@ -95,7 +100,7 @@ class SyncNotificationControllerTest : RobolectricTest() { controller.showEmptyFetchingMailNotification(account) verify(notificationManager).notify(notificationId, notification) - verify(builder).setSmallIcon(resourceProvider.iconCheckingMail) + verify(builder).setSmallIcon(iconResourceProvider.pushNotificationIcon) verify(builder).setContentTitle("Checking mail") verify(builder).setContentText(ACCOUNT_NAME) verify(builder).setPublicVersion(lockScreenNotification) diff --git a/legacy/core/src/test/java/com/fsck/k9/notification/TestNotificationIconResourceProvider.kt b/legacy/core/src/test/java/com/fsck/k9/notification/TestNotificationIconResourceProvider.kt new file mode 100644 index 00000000000..f13b0dc2d0d --- /dev/null +++ b/legacy/core/src/test/java/com/fsck/k9/notification/TestNotificationIconResourceProvider.kt @@ -0,0 +1,7 @@ +package com.fsck.k9.notification + +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider + +class TestNotificationIconResourceProvider( + override val pushNotificationIcon: Int = 9999, +) : NotificationIconResourceProvider diff --git a/legacy/ui/legacy/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt b/legacy/ui/legacy/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt index 5562a6fd57e..b099f53e7cd 100644 --- a/legacy/ui/legacy/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt +++ b/legacy/ui/legacy/src/test/java/com/fsck/k9/TestCoreResourceProvider.kt @@ -26,9 +26,6 @@ class TestCoreResourceProvider : CoreResourceProvider { override fun searchUnifiedFoldersTitle() = throw UnsupportedOperationException("not implemented") override fun searchUnifiedFoldersDetail() = throw UnsupportedOperationException("not implemented") - override val iconPushNotification: Int - get() = throw UnsupportedOperationException("not implemented") - override fun pushNotificationText(notificationState: PushNotificationState): String { throw UnsupportedOperationException("not implemented") } From a85179c4ae67d792cd0d991e419d7e4b3e81b1ff Mon Sep 17 00:00:00 2001 From: Su TT Date: Fri, 12 Sep 2025 19:02:34 -0400 Subject: [PATCH 2/7] Update badging baseline for fossBeta --- app-thunderbird/badging/fossBeta-badging.txt | 16 ++++++++-------- gradle/libs.versions.toml | 6 ++---- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/app-thunderbird/badging/fossBeta-badging.txt b/app-thunderbird/badging/fossBeta-badging.txt index f3b7594cc18..3bd2f8bf53a 100644 --- a/app-thunderbird/badging/fossBeta-badging.txt +++ b/app-thunderbird/badging/fossBeta-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/drawable/ic_app_logo.xml' -application-icon-160:'res/drawable/ic_app_logo.xml' -application-icon-240:'res/drawable/ic_app_logo.xml' -application-icon-320:'res/drawable/ic_app_logo.xml' -application-icon-480:'res/drawable/ic_app_logo.xml' -application-icon-640:'res/drawable/ic_app_logo.xml' -application-icon-65534:'res/drawable/ic_app_logo.xml' +application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' application-label-ar:'Thunderbird Beta' application-label-be:'Thunderbird Beta' application-label-bg:'Thunderbird Beta' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Beta' application-label-zh-TW:'Thunderbird Beta' application-label-zh:'Thunderbird Beta' application-label:'Thunderbird Beta' -application: label='Thunderbird Beta' icon='res/drawable/ic_app_logo.xml' +application: label='Thunderbird Beta' icon='res/mipmap-anydpi-v26/ic_launcher.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6accff8b547..cdf4a18ea92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -164,8 +164,8 @@ androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util" } androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidxConstraintLayout" } androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorlayout", version.ref = "androidxCoordinatorLayout" } -androidx-core = { module = "androidx.core:core", version.ref = "androidxTestCore" } -androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxTestCore" } +androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" } androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidxDatastore" } androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidxDatastore" } @@ -194,7 +194,6 @@ androidx-preference = { module = "androidx.preference:preference", version.ref = androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerView" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidxSwiperefreshlayout" } androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } -androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" } androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" } androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } @@ -285,7 +284,6 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } xmlpull = { module = "com.github.cketti:xmlpull-extracted-from-android", version.ref = "xmlpull" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } - [bundles] shared-kmp-common = [ "koin-core", From 4bc69d2d5b7e517cf62db33ac79ca177997ca903 Mon Sep 17 00:00:00 2001 From: Su TT Date: Fri, 12 Sep 2025 19:11:34 -0400 Subject: [PATCH 3/7] Revert unecessary changes to fix #8932 --- app-k9mail/src/debug/AndroidManifest.xml | 3 - app-thunderbird/badging/fossDaily-badging.txt | 18 +++--- app-thunderbird/badging/fullBeta-badging.txt | 4 +- app-thunderbird/badging/fullDaily-badging.txt | 18 +++--- app-thunderbird/src/main/AndroidManifest.xml | 2 +- gradle/libs.versions.toml | 63 ++++++++++++++----- .../java/com/fsck/k9/resources/KoinModule.kt | 1 - 7 files changed, 70 insertions(+), 39 deletions(-) diff --git a/app-k9mail/src/debug/AndroidManifest.xml b/app-k9mail/src/debug/AndroidManifest.xml index 9b026cae36a..689e9c615a4 100644 --- a/app-k9mail/src/debug/AndroidManifest.xml +++ b/app-k9mail/src/debug/AndroidManifest.xml @@ -24,7 +24,4 @@ - - - diff --git a/app-thunderbird/badging/fossDaily-badging.txt b/app-thunderbird/badging/fossDaily-badging.txt index 5d690d439fc..25dc33568d5 100644 --- a/app-thunderbird/badging/fossDaily-badging.txt +++ b/app-thunderbird/badging/fossDaily-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/drawable/ic_app_logo.xml' -application-icon-160:'res/drawable/ic_app_logo.xml' -application-icon-240:'res/drawable/ic_app_logo.xml' -application-icon-320:'res/drawable/ic_app_logo.xml' -application-icon-480:'res/drawable/ic_app_logo.xml' -application-icon-640:'res/drawable/ic_app_logo.xml' -application-icon-65534:'res/drawable/ic_app_logo.xml' +application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' application-label-ar:'Thunderbird Daily' application-label-be:'Thunderbird Daily' application-label-bg:'Thunderbird Daily' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Daily' application-label-zh-TW:'Thunderbird Daily' application-label-zh:'Thunderbird Daily' application-label:'Thunderbird Daily' -application: label='Thunderbird Daily' icon='res/drawable/ic_app_logo.xml' +application: label='Thunderbird Daily' icon='res/mipmap-anydpi-v26/ic_launcher.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.daily' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/badging/fullBeta-badging.txt b/app-thunderbird/badging/fullBeta-badging.txt index 1386af2d372..8687182e784 100644 --- a/app-thunderbird/badging/fullBeta-badging.txt +++ b/app-thunderbird/badging/fullBeta-badging.txt @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Beta' application-label-zh-TW:'Thunderbird Beta' application-label-zh:'Thunderbird Beta' application-label:'Thunderbird Beta' -application: label='Thunderbird Beta' icon='res/drawable/ic_app_logo.xml' +application: label='Thunderbird Beta' icon='res/mipmap-anydpi-v26/ic_launcher.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.beta' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/badging/fullDaily-badging.txt b/app-thunderbird/badging/fullDaily-badging.txt index e3d6d486e02..7029e6308ed 100644 --- a/app-thunderbird/badging/fullDaily-badging.txt +++ b/app-thunderbird/badging/fullDaily-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/drawable/ic_app_logo.xml' -application-icon-160:'res/drawable/ic_app_logo.xml' -application-icon-240:'res/drawable/ic_app_logo.xml' -application-icon-320:'res/drawable/ic_app_logo.xml' -application-icon-480:'res/drawable/ic_app_logo.xml' -application-icon-640:'res/drawable/ic_app_logo.xml' -application-icon-65534:'res/drawable/ic_app_logo.xml' +application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' application-label-ar:'Thunderbird Daily' application-label-be:'Thunderbird Daily' application-label-bg:'Thunderbird Daily' @@ -62,7 +62,7 @@ application-label-zh-CN:'Thunderbird Daily' application-label-zh-TW:'Thunderbird Daily' application-label-zh:'Thunderbird Daily' application-label:'Thunderbird Daily' -application: label='Thunderbird Daily' icon='res/drawable/ic_app_logo.xml' +application: label='Thunderbird Daily' icon='res/mipmap-anydpi-v26/ic_launcher.xml' densities: '120' '160' '240' '320' '480' '640' '65534' feature-group: label='' install-location:'auto' @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.daily' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/src/main/AndroidManifest.xml b/app-thunderbird/src/main/AndroidManifest.xml index 5405ae49f09..780fcb614c6 100644 --- a/app-thunderbird/src/main/AndroidManifest.xml +++ b/app-thunderbird/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cdf4a18ea92..59cd3d27adc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,10 +14,16 @@ androidBilling = "7.1.1" androidDesugar = "2.1.5" androidMaterial = "1.12.0" +<<<<<<< HEAD # AGP and tools should be updated together. # Also, make sure AGP version is compatible with both AS and IntelliJ IDEA. androidGradlePlugin = "8.12.3" androidTools = "31.11.1" +======= +# AGP and tools should be updated together +androidGradlePlugin = "8.10.1" +androidTools = "31.10.1" +>>>>>>> 46746d706b (Revert unecessary changes to fix #8932) androidxActivity = "1.10.1" androidxAnnotation = "1.9.1" androidxAppCompat = "1.7.1" @@ -25,45 +31,62 @@ androidxAutofill = "1.3.0" androidxBiometric = "1.1.0" androidxCamera = "1.4.2" # https://developer.android.com/jetpack/compose/bom/bom-mapping -androidxComposeBom = "2025.07.00" +androidxComposeBom = "2025.06.00" androidxConstraintLayout = "2.2.1" androidxCoordinatorLayout = "1.3.0" androidxCore = "1.16.0" androidxCoreSplashscreen = "1.0.1" -androidxDatastore = "1.1.7" androidxFragment = "1.8.8" androidxGlance = "1.1.1" androidxGlanceMaterial3 = "1.1.1" -androidxLifecycle = "2.9.2" +androidxLifecycle = "2.9.1" androidxLocalBroadcastManager = "1.1.0" -androidxNavigation = "2.9.3" +androidxNavigation = "2.9.0" androidxRecyclerView = "1.4.0" androidxPreference = "1.2.1" androidxSwiperefreshlayout = "1.1.0" -androidxTestCore = "1.7.0" -androidxTestEspresso = "3.7.0" -androidxTestExt = "1.3.0" -androidxTestRules = "1.7.0" -androidxTestRunner = "1.7.0" +androidxTestCore = "1.6.1" +androidxTestEspresso = "3.6.1" +androidxTestExt = "1.2.1" +androidxTestRules = "1.6.1" +androidxTestRunner = "1.6.2" androidxWebkit = "1.14.0" +<<<<<<< HEAD androidxWork = "2.10.3" apacheHttpclient5 = "5.5.1" +======= +androidxWork = "2.10.1" +apacheHttpclient5 = "5.4.4" +>>>>>>> 46746d706b (Revert unecessary changes to fix #8932) appAuth = "0.11.1" assertk = "0.28.1" circleImageView = "3.1.0" ckchangelog = "2.0.0-beta02" clikt = "5.0.3" +<<<<<<< HEAD commonsIo = "2.20.0" dependencyCheckPlugin = "0.53.0" +======= +commonsIo = "2.19.0" +dependencyCheckPlugin = "0.52.0" +>>>>>>> 46746d706b (Revert unecessary changes to fix #8932) dependencyGuardPlugin = "0.5.0" detektPlugin = "1.23.8" detektPluginCompose = "0.4.27" fastAdapter = "5.7.0" +<<<<<<< HEAD forkhandlesBom = "2.23.0.0" glide = "4.16.0" gradle = "9.1.0" icu4j = "77.1" javaDiffUtils = "4.16" +======= +forkhandlesBom = "2.22.3.0" +glide = "4.16.0" +gradle = "8.14.2" +icu4j = "72.1" +javaDiffUtils = "4.12" +>>>>>>> 46746d706b (Revert unecessary changes to fix #8932) jcipAnnotations = "1.0" jetbrainsAnnotations = "26.0.2-1" jetbrainsCompose = "1.9.0" @@ -83,12 +106,13 @@ kotlinGradleBom = "2.2.0" kotlinKsp = "2.3.0" kotlinxCoroutines = "1.10.2" kotlinxCollectionsImmutable = "0.4.0" -kotlinxDateTime = "0.7.1" -kotlinxIoCore = "0.8.0" -kotlinxSerialization = "1.9.0" +kotlinxDateTime = "0.7.0" +kotlinxIoCore = "0.7.0" +kotlinxSerialization = "1.8.1" ktlint = "1.5.0" ktor = "3.3.1" kxml2 = "1.0" +<<<<<<< HEAD landscapist = "2.6.1" leakcanary = "2.14" logbackClassic = "1.5.20" @@ -97,11 +121,22 @@ minidns = "1.1.1" mockito = "5.20.0" mockitoKotlin = "6.1.0" mokkery = "2.10.2" +======= +landscapist = "2.5.0" +leakcanary = "2.13" +logbackClassic = "1.5.18" +mime4j = "0.8.12" +minidns = "1.0.5" +mockito = "5.18.0" +mockitoKotlin = "6.0.0" +mokkery = "2.10.0" +>>>>>>> 46746d706b (Revert unecessary changes to fix #8932) moshi = "1.15.2" mozillaAndroidComponents = "144.0.2" okhttp = "5.2.1" okio = "3.16.2" preferencesFix = "1.1.0" +<<<<<<< HEAD robolectric = "4.16" safeContentResolver = "1.0.0" searchPreference = "2.7.3" @@ -167,8 +202,6 @@ androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorl androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" } androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" } -androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidxDatastore" } -androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidxDatastore" } androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "androidxFragment" } androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "androidxFragment" } androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "androidxFragment" } @@ -194,6 +227,7 @@ androidx-preference = { module = "androidx.preference:preference", version.ref = androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerView" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidxSwiperefreshlayout" } androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } +androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" } androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" } androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } @@ -284,6 +318,7 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } xmlpull = { module = "com.github.cketti:xmlpull-extracted-from-android", version.ref = "xmlpull" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } + [bundles] shared-kmp-common = [ "koin-core", diff --git a/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt b/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt index 6a35b72c893..60bd01ff447 100644 --- a/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt +++ b/legacy/common/src/main/java/com/fsck/k9/resources/KoinModule.kt @@ -5,7 +5,6 @@ import com.fsck.k9.autocrypt.AutocryptStringProvider import org.koin.dsl.module val resourcesModule = module { - single { K9CoreResourceProvider( context = get(), From f52213f218686160caa2ae660ef416e898e90235 Mon Sep 17 00:00:00 2001 From: Su TT Date: Mon, 15 Sep 2025 08:45:24 -0400 Subject: [PATCH 4/7] Resolve merge conflicts --- legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt b/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt index 671908df61e..ff2dc5d75e1 100644 --- a/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt +++ b/legacy/core/src/main/java/com/fsck/k9/CoreResourceProvider.kt @@ -24,9 +24,6 @@ interface CoreResourceProvider { fun searchUnifiedFoldersTitle(): String fun searchUnifiedFoldersDetail(): String - - val iconPushNotification: Int - fun pushNotificationText(notificationState: PushNotificationState): String fun pushNotificationInfoText(): String fun pushNotificationGrantAlarmPermissionText(): String From babd4e6efbb1cdecc2f9b3b26c7cf4950b150276 Mon Sep 17 00:00:00 2001 From: Su TT Date: Wed, 29 Oct 2025 17:56:24 -0700 Subject: [PATCH 5/7] fix(test): provide notification icon provider mocks --- .../notification/PushIconTestNotification.kt | 1 + gradle/libs.versions.toml | 63 +++++-------------- .../core/src/test/java/com/fsck/k9/TestApp.kt | 3 + .../test/java/com/fsck/k9/storage/TestApp.kt | 6 ++ 4 files changed, 24 insertions(+), 49 deletions(-) diff --git a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt index 00cbdb4dfe1..8a5c53d2f2e 100644 --- a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt +++ b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/PushIconTestNotification.kt @@ -8,6 +8,7 @@ import net.thunderbird.feature.notification.api.ui.icon.NotificationIcon class PushIconTestNotification( pushIcon: Int, + override val accountUuid: String? = null, ) : AppNotification(), SystemNotification { override val title: String = "Push Icon Test" override val contentText: String = "Verifying NotificationIconResourceProvider" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 59cd3d27adc..cdf4a18ea92 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,16 +14,10 @@ androidBilling = "7.1.1" androidDesugar = "2.1.5" androidMaterial = "1.12.0" -<<<<<<< HEAD # AGP and tools should be updated together. # Also, make sure AGP version is compatible with both AS and IntelliJ IDEA. androidGradlePlugin = "8.12.3" androidTools = "31.11.1" -======= -# AGP and tools should be updated together -androidGradlePlugin = "8.10.1" -androidTools = "31.10.1" ->>>>>>> 46746d706b (Revert unecessary changes to fix #8932) androidxActivity = "1.10.1" androidxAnnotation = "1.9.1" androidxAppCompat = "1.7.1" @@ -31,62 +25,45 @@ androidxAutofill = "1.3.0" androidxBiometric = "1.1.0" androidxCamera = "1.4.2" # https://developer.android.com/jetpack/compose/bom/bom-mapping -androidxComposeBom = "2025.06.00" +androidxComposeBom = "2025.07.00" androidxConstraintLayout = "2.2.1" androidxCoordinatorLayout = "1.3.0" androidxCore = "1.16.0" androidxCoreSplashscreen = "1.0.1" +androidxDatastore = "1.1.7" androidxFragment = "1.8.8" androidxGlance = "1.1.1" androidxGlanceMaterial3 = "1.1.1" -androidxLifecycle = "2.9.1" +androidxLifecycle = "2.9.2" androidxLocalBroadcastManager = "1.1.0" -androidxNavigation = "2.9.0" +androidxNavigation = "2.9.3" androidxRecyclerView = "1.4.0" androidxPreference = "1.2.1" androidxSwiperefreshlayout = "1.1.0" -androidxTestCore = "1.6.1" -androidxTestEspresso = "3.6.1" -androidxTestExt = "1.2.1" -androidxTestRules = "1.6.1" -androidxTestRunner = "1.6.2" +androidxTestCore = "1.7.0" +androidxTestEspresso = "3.7.0" +androidxTestExt = "1.3.0" +androidxTestRules = "1.7.0" +androidxTestRunner = "1.7.0" androidxWebkit = "1.14.0" -<<<<<<< HEAD androidxWork = "2.10.3" apacheHttpclient5 = "5.5.1" -======= -androidxWork = "2.10.1" -apacheHttpclient5 = "5.4.4" ->>>>>>> 46746d706b (Revert unecessary changes to fix #8932) appAuth = "0.11.1" assertk = "0.28.1" circleImageView = "3.1.0" ckchangelog = "2.0.0-beta02" clikt = "5.0.3" -<<<<<<< HEAD commonsIo = "2.20.0" dependencyCheckPlugin = "0.53.0" -======= -commonsIo = "2.19.0" -dependencyCheckPlugin = "0.52.0" ->>>>>>> 46746d706b (Revert unecessary changes to fix #8932) dependencyGuardPlugin = "0.5.0" detektPlugin = "1.23.8" detektPluginCompose = "0.4.27" fastAdapter = "5.7.0" -<<<<<<< HEAD forkhandlesBom = "2.23.0.0" glide = "4.16.0" gradle = "9.1.0" icu4j = "77.1" javaDiffUtils = "4.16" -======= -forkhandlesBom = "2.22.3.0" -glide = "4.16.0" -gradle = "8.14.2" -icu4j = "72.1" -javaDiffUtils = "4.12" ->>>>>>> 46746d706b (Revert unecessary changes to fix #8932) jcipAnnotations = "1.0" jetbrainsAnnotations = "26.0.2-1" jetbrainsCompose = "1.9.0" @@ -106,13 +83,12 @@ kotlinGradleBom = "2.2.0" kotlinKsp = "2.3.0" kotlinxCoroutines = "1.10.2" kotlinxCollectionsImmutable = "0.4.0" -kotlinxDateTime = "0.7.0" -kotlinxIoCore = "0.7.0" -kotlinxSerialization = "1.8.1" +kotlinxDateTime = "0.7.1" +kotlinxIoCore = "0.8.0" +kotlinxSerialization = "1.9.0" ktlint = "1.5.0" ktor = "3.3.1" kxml2 = "1.0" -<<<<<<< HEAD landscapist = "2.6.1" leakcanary = "2.14" logbackClassic = "1.5.20" @@ -121,22 +97,11 @@ minidns = "1.1.1" mockito = "5.20.0" mockitoKotlin = "6.1.0" mokkery = "2.10.2" -======= -landscapist = "2.5.0" -leakcanary = "2.13" -logbackClassic = "1.5.18" -mime4j = "0.8.12" -minidns = "1.0.5" -mockito = "5.18.0" -mockitoKotlin = "6.0.0" -mokkery = "2.10.0" ->>>>>>> 46746d706b (Revert unecessary changes to fix #8932) moshi = "1.15.2" mozillaAndroidComponents = "144.0.2" okhttp = "5.2.1" okio = "3.16.2" preferencesFix = "1.1.0" -<<<<<<< HEAD robolectric = "4.16" safeContentResolver = "1.0.0" searchPreference = "2.7.3" @@ -202,6 +167,8 @@ androidx-coordinatorlayout = { module = "androidx.coordinatorlayout:coordinatorl androidx-core = { module = "androidx.core:core", version.ref = "androidxCore" } androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidxCore" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidxCoreSplashscreen" } +androidx-datastore = { module = "androidx.datastore:datastore", version.ref = "androidxDatastore" } +androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "androidxDatastore" } androidx-fragment = { module = "androidx.fragment:fragment", version.ref = "androidxFragment" } androidx-fragment-compose = { module = "androidx.fragment:fragment-compose", version.ref = "androidxFragment" } androidx-fragment-testing = { module = "androidx.fragment:fragment-testing", version.ref = "androidxFragment" } @@ -227,7 +194,6 @@ androidx-preference = { module = "androidx.preference:preference", version.ref = androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidxRecyclerView" } androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "androidxSwiperefreshlayout" } androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } -androidx-test-core-ktx = { module = "androidx.test:core-ktx", version.ref = "androidxTestCore" } androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidxTestEspresso" } androidx-test-ext-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "androidxTestExt" } androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTestRules" } @@ -318,7 +284,6 @@ uri = { module = "com.eygraber:uri-kmp", version.ref = "uri" } xmlpull = { module = "com.github.cketti:xmlpull-extracted-from-android", version.ref = "xmlpull" } zxing = { module = "com.google.zxing:core", version.ref = "zxing" } - [bundles] shared-kmp-common = [ "koin-core", diff --git a/legacy/core/src/test/java/com/fsck/k9/TestApp.kt b/legacy/core/src/test/java/com/fsck/k9/TestApp.kt index e0d12e93e5e..57d704a077a 100644 --- a/legacy/core/src/test/java/com/fsck/k9/TestApp.kt +++ b/legacy/core/src/test/java/com/fsck/k9/TestApp.kt @@ -2,6 +2,7 @@ package com.fsck.k9 import android.app.Application import androidx.work.WorkManager +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import app.k9mail.feature.telemetry.telemetryModule import app.k9mail.legacy.di.DI import com.fsck.k9.backend.BackendManager @@ -10,6 +11,7 @@ import com.fsck.k9.crypto.EncryptionExtractor import com.fsck.k9.notification.NotificationActionCreator import com.fsck.k9.notification.NotificationResourceProvider import com.fsck.k9.notification.NotificationStrategy +import com.fsck.k9.notification.TestNotificationIconResourceProvider import com.fsck.k9.storage.storageModule import net.thunderbird.core.android.account.AccountDefaultsProvider import net.thunderbird.core.android.account.LegacyAccountManager @@ -93,4 +95,5 @@ val testModule = module { } single { FakeOutboxFolderManager() } single { mock() } + single { TestNotificationIconResourceProvider() } } diff --git a/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt b/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt index 9b3e0e150e0..f4681413ccb 100644 --- a/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt +++ b/legacy/storage/src/test/java/com/fsck/k9/storage/TestApp.kt @@ -1,6 +1,7 @@ package com.fsck.k9.storage import android.app.Application +import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import app.k9mail.feature.telemetry.telemetryModule import app.k9mail.legacy.di.DI import com.fsck.k9.AppConfig @@ -83,4 +84,9 @@ val testModule = module { ) } single { mock() } + single { + object : NotificationIconResourceProvider { + override val pushNotificationIcon: Int = 0 + } + } } From 4a344b54dac08b3e30f07788d5556e9a2d269687 Mon Sep 17 00:00:00 2001 From: Rafael Tonholo Date: Thu, 6 Nov 2025 13:48:19 -0400 Subject: [PATCH 6/7] chore: reverting unnecessary changes --- app-thunderbird/badging/fossDaily-badging.txt | 2 +- app-thunderbird/badging/fullBeta-badging.txt | 16 ++++++++-------- app-thunderbird/badging/fullDaily-badging.txt | 2 +- .../thunderbird/android/ThunderbirdKoinModule.kt | 1 + .../notification/CoreNotificationKoinModule.kt | 1 - 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app-thunderbird/badging/fossDaily-badging.txt b/app-thunderbird/badging/fossDaily-badging.txt index 25dc33568d5..e55ca6989f4 100644 --- a/app-thunderbird/badging/fossDaily-badging.txt +++ b/app-thunderbird/badging/fossDaily-badging.txt @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.daily' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/badging/fullBeta-badging.txt b/app-thunderbird/badging/fullBeta-badging.txt index 8687182e784..1e4a87bcac8 100644 --- a/app-thunderbird/badging/fullBeta-badging.txt +++ b/app-thunderbird/badging/fullBeta-badging.txt @@ -1,10 +1,10 @@ -application-icon-120:'res/drawable/ic_app_logo.xml' -application-icon-160:'res/drawable/ic_app_logo.xml' -application-icon-240:'res/drawable/ic_app_logo.xml' -application-icon-320:'res/drawable/ic_app_logo.xml' -application-icon-480:'res/drawable/ic_app_logo.xml' -application-icon-640:'res/drawable/ic_app_logo.xml' -application-icon-65534:'res/drawable/ic_app_logo.xml' +application-icon-120:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-160:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-240:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-320:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-480:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-640:'res/mipmap-anydpi-v26/ic_launcher.xml' +application-icon-65534:'res/mipmap-anydpi-v26/ic_launcher.xml' application-label-ar:'Thunderbird Beta' application-label-be:'Thunderbird Beta' application-label-bg:'Thunderbird Beta' @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.beta' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/badging/fullDaily-badging.txt b/app-thunderbird/badging/fullDaily-badging.txt index 7029e6308ed..ed9d025abd2 100644 --- a/app-thunderbird/badging/fullDaily-badging.txt +++ b/app-thunderbird/badging/fullDaily-badging.txt @@ -75,7 +75,7 @@ other-activities other-receivers other-services package: name='net.thunderbird.android.daily' platformBuildVersionName='16' platformBuildVersionCode='36' compileSdkVersion='36' compileSdkVersionCodename='16' -property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' +property: name='android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE' value='This service is used to maintain a continuous connection to an IMAP server to be able to provide instant notifications to the user when a new email arrives. Firebase Cloud Messaging is not suitable for this task, neither are mechanisms like AndroidX WorkManager. Other foreground service types aren't a good fit for this use case.' provides-component:'app-widget' supports-any-density: 'true' supports-screens: 'small' 'normal' 'large' 'xlarge' diff --git a/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt b/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt index 6930fc13167..c8dc26e9088 100644 --- a/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt +++ b/app-thunderbird/src/main/kotlin/net/thunderbird/android/ThunderbirdKoinModule.kt @@ -1,4 +1,5 @@ package net.thunderbird.android + import app.k9mail.feature.widget.shortcut.LauncherShortcutActivity import com.fsck.k9.AppConfig import com.fsck.k9.DefaultAppConfig diff --git a/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt b/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt index 6fad3e7bd28..826da8130cb 100644 --- a/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt +++ b/legacy/core/src/main/java/com/fsck/k9/notification/CoreNotificationKoinModule.kt @@ -5,7 +5,6 @@ import android.content.Context import androidx.core.app.NotificationManagerCompat import java.util.concurrent.Executors import kotlin.time.ExperimentalTime -import org.koin.core.scope.get import org.koin.dsl.module val coreNotificationModule = module { From 2a4d3cc621ec168c0b2c697b450bf45f17eb0f0e Mon Sep 17 00:00:00 2001 From: Rafael Tonholo Date: Thu, 6 Nov 2025 13:48:19 -0400 Subject: [PATCH 7/7] chore: reverting unnecessary changes --- .../settings/notification/DebugNotificationSectionViewModel.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt index 7a6663eac4b..c1c12202c62 100644 --- a/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt +++ b/feature/debug-settings/src/main/kotlin/net/thunderbird/feature/debug/settings/notification/DebugNotificationSectionViewModel.kt @@ -3,7 +3,6 @@ package net.thunderbird.feature.debug.settings.notification import androidx.lifecycle.viewModelScope import app.k9mail.core.android.common.provider.NotificationIconResourceProvider import app.k9mail.core.ui.compose.common.mvi.BaseViewModel -import kotlin.jvm.java import kotlin.reflect.KClass import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf