diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt index f632fb0fa0..3e7cdb13e0 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin import info.nightscout.androidaps.plugins.bus.RxBusWrapper import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin import info.nightscout.androidaps.plugins.configBuilder.PluginStore -import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefs +import info.nightscout.androidaps.plugins.general.maintenance.ImportExportPrefsImpl import info.nightscout.androidaps.plugins.general.nsclient.DataSyncSelectorImplementation import info.nightscout.androidaps.plugins.general.nsclient.UploadQueue import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin @@ -83,7 +83,7 @@ open class AppModule { @Binds fun bindTreatmentsInterface(treatmentsPlugin: TreatmentsPlugin): TreatmentsInterface @Binds fun bindDatabaseHelperInterface(databaseHelperProvider: DatabaseHelperProvider): DatabaseHelperInterface @Binds fun bindNotificationHolderInterface(notificationHolder: NotificationHolder): NotificationHolderInterface - @Binds fun bindImportExportPrefsInterface(importExportPrefs: ImportExportPrefs): ImportExportPrefsInterface + @Binds fun bindImportExportPrefsInterface(importExportPrefs: ImportExportPrefsImpl): ImportExportPrefs @Binds fun bindIconsProviderInterface(iconsProvider: IconsProviderImplementation): IconsProvider @Binds fun bindLoopInterface(loopPlugin: LoopPlugin): LoopInterface @Binds fun bindIobCobCalculatorInterface(iobCobCalculatorPlugin: IobCobCalculatorPlugin): IobCobCalculator diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt similarity index 99% rename from app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt rename to app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index f3eff91beb..bf83f2c5bc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefs.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.events.EventAppExit import info.nightscout.androidaps.interfaces.Config -import info.nightscout.androidaps.interfaces.ImportExportPrefsInterface +import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.UserEntryLogger @@ -50,7 +50,7 @@ import kotlin.system.exitProcess */ @Singleton -class ImportExportPrefs @Inject constructor( +class ImportExportPrefsImpl @Inject constructor( private var log: AAPSLogger, private val resourceHelper: ResourceHelper, private val sp: SP, @@ -64,7 +64,7 @@ class ImportExportPrefs @Inject constructor( private val prefFileList: PrefFileListProvider, private val uel: UserEntryLogger, private val dateUtil: DateUtil -) : ImportExportPrefsInterface { +) : ImportExportPrefs { override fun prefsFileExists(): Boolean { return prefFileList.listPreferenceFiles().size > 0 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index 873ef0745e..4337808106 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.databinding.MaintenanceFragmentBinding import info.nightscout.androidaps.events.EventNewBG import info.nightscout.androidaps.interfaces.DataSyncSelector import info.nightscout.androidaps.interfaces.DatabaseHelperInterface -import info.nightscout.androidaps.interfaces.ImportExportPrefsInterface +import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.UserEntryLogger @@ -35,7 +35,7 @@ class MaintenanceFragment : DaggerFragment() { @Inject lateinit var maintenancePlugin: MaintenancePlugin @Inject lateinit var rxBus: RxBusWrapper @Inject lateinit var resourceHelper: ResourceHelper - @Inject lateinit var importExportPrefs: ImportExportPrefsInterface + @Inject lateinit var importExportPrefs: ImportExportPrefs @Inject lateinit var aapsSchedulers: AapsSchedulers @Inject lateinit var repository: AppRepository @Inject lateinit var databaseHelper: DatabaseHelperInterface diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt index 5e76792b4a..9bbc46d63b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.database.entities.UserEntry.Sources import info.nightscout.androidaps.databinding.TreatmentsUserEntryFragmentBinding import info.nightscout.androidaps.databinding.TreatmentsUserEntryItemBinding import info.nightscout.androidaps.events.EventPreferenceChange -import info.nightscout.androidaps.interfaces.ImportExportPrefsInterface +import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.bus.RxBusWrapper @@ -42,7 +42,7 @@ class TreatmentsUserEntryFragment : DaggerFragment() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var rxBus: RxBusWrapper @Inject lateinit var translator: Translator - @Inject lateinit var importExportPrefs: ImportExportPrefsInterface + @Inject lateinit var importExportPrefs: ImportExportPrefs @Inject lateinit var uel: UserEntryLogger @Inject lateinit var userEntryPresentationHelper: UserEntryPresentationHelper diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt index 4ccc38a102..7c83af9360 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -54,7 +54,7 @@ class SWDefinition @Inject constructor( private val loopPlugin: LoopPlugin, private val nsClientPlugin: NSClientPlugin, private val nsProfilePlugin: NSProfilePlugin, - private val importExportPrefs: ImportExportPrefsInterface, + private val importExportPrefs: ImportExportPrefs, private val androidPermission: AndroidPermission, private val cryptoUtil: CryptoUtil, private val config: ConfigImpl diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index f28a06d286..986ef95719 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -6,7 +6,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.interfaces.ImportExportPrefsInterface +import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.permissions.OptimizationPermissionContract @@ -16,7 +16,7 @@ import javax.inject.Inject open class DaggerAppCompatActivityWithResult : DaggerAppCompatActivity() { @Inject lateinit var resourceHelper: ResourceHelperImplementation - @Inject lateinit var importExportPrefs: ImportExportPrefsInterface + @Inject lateinit var importExportPrefs: ImportExportPrefs val callForPrefFile = registerForActivityResult(PrefsFileContract()) { it?.let { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefsInterface.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt similarity index 95% rename from core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefsInterface.kt rename to core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt index e003e02fcf..81782fbb88 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefsInterface.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.plugins.general.maintenance.PrefsFile import io.reactivex.Single -interface ImportExportPrefsInterface { +interface ImportExportPrefs { fun importSharedPreferences(activity: FragmentActivity, importFile: PrefsFile) fun importSharedPreferences(activity: FragmentActivity)