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

Unverified Commit 6d19a99b authored by Shamim Shahrier Emon's avatar Shamim Shahrier Emon Committed by GitHub
Browse files

Use app-specific prefix for settings file name on export (#8382)

parent 56eaf0a5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import app.k9mail.widget.appWidgetModule
import com.fsck.k9.AppConfig
import com.fsck.k9.BuildConfig
import com.fsck.k9.activity.MessageCompose
import com.fsck.k9.preferences.FilePrefixProvider
import com.fsck.k9.provider.K9ThemeProvider
import com.fsck.k9.provider.UnreadWidgetProvider
import com.fsck.k9.widget.list.MessageListWidgetProvider
@@ -39,7 +40,9 @@ val appModule = module {
    single(named("ClientInfoAppVersion")) { BuildConfig.VERSION_NAME }
    single<AppConfig> { appConfig }
    single<OAuthConfigurationFactory> { K9OAuthConfigurationFactory() }
    single { K9AppNameProvider(androidContext()) } binds arrayOf(AppNameProvider::class, BrandNameProvider::class)
    single {
        K9AppNameProvider(androidContext())
    } binds arrayOf(AppNameProvider::class, BrandNameProvider::class, FilePrefixProvider::class)
    single<ThemeProvider> { K9ThemeProvider() }
    single<FeatureThemeProvider> { K9FeatureThemeProvider() }
    single<FeatureFlagFactory> { K9FeatureFlagFactory() }
+4 −1
Original line number Diff line number Diff line
@@ -4,10 +4,11 @@ import android.content.Context
import app.k9mail.core.common.provider.AppNameProvider
import app.k9mail.core.common.provider.BrandNameProvider
import com.fsck.k9.R
import com.fsck.k9.preferences.FilePrefixProvider

class K9AppNameProvider(
    context: Context,
) : AppNameProvider, BrandNameProvider {
) : AppNameProvider, BrandNameProvider, FilePrefixProvider {
    override val appName: String by lazy {
        context.getString(R.string.app_name)
    }
@@ -15,4 +16,6 @@ class K9AppNameProvider(
    override val brandName: String by lazy {
        context.getString(R.string.app_name)
    }

    override val filePrefix: String = "k9"
}
+4 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ import app.k9mail.feature.telemetry.telemetryModule
import app.k9mail.feature.widget.shortcut.LauncherShortcutActivity
import com.fsck.k9.AppConfig
import com.fsck.k9.activity.MessageCompose
import com.fsck.k9.preferences.FilePrefixProvider
import net.thunderbird.android.auth.TbOAuthConfigurationFactory
import net.thunderbird.android.dev.developmentModuleAdditions
import net.thunderbird.android.featureflag.TbFeatureFlagFactory
@@ -38,7 +39,9 @@ val appModule = module {
    single(named("ClientInfoAppVersion")) { BuildConfig.VERSION_NAME }
    single<AppConfig> { appConfig }
    single<OAuthConfigurationFactory> { TbOAuthConfigurationFactory() }
    single { TbAppNameProvider(androidContext()) } binds arrayOf(AppNameProvider::class, BrandNameProvider::class)
    single {
        TbAppNameProvider(androidContext())
    } binds arrayOf(AppNameProvider::class, BrandNameProvider::class, FilePrefixProvider::class)
    single<ThemeProvider> { TbThemeProvider() }
    single<FeatureThemeProvider> { TbFeatureThemeProvider() }
    single<FeatureFlagFactory> { TbFeatureFlagFactory() }
+4 −1
Original line number Diff line number Diff line
@@ -3,11 +3,12 @@ package net.thunderbird.android.provider
import android.content.Context
import app.k9mail.core.common.provider.AppNameProvider
import app.k9mail.core.common.provider.BrandNameProvider
import com.fsck.k9.preferences.FilePrefixProvider
import net.thunderbird.android.R

class TbAppNameProvider(
    context: Context,
) : AppNameProvider, BrandNameProvider {
) : AppNameProvider, BrandNameProvider, FilePrefixProvider {
    override val appName: String by lazy {
        context.getString(R.string.app_name)
    }
@@ -15,4 +16,6 @@ class TbAppNameProvider(
    override val brandName: String by lazy {
        context.getString(R.string.brand_name)
    }

    override val filePrefix: String = "thunderbird"
}
+5 −0
Original line number Diff line number Diff line
package com.fsck.k9.preferences

interface FilePrefixProvider {
    val filePrefix: String
}
Loading