diff --git a/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt index 5d538365f6..0146159325 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ActivitiesModule.kt @@ -5,17 +5,13 @@ import dagger.android.ContributesAndroidInjector import info.nightscout.androidaps.MainActivity import info.nightscout.androidaps.activities.HistoryBrowseActivity import info.nightscout.androidaps.activities.PreferencesActivity -import info.nightscout.configuration.activities.SingleFragmentActivity -import info.nightscout.configuration.maintenance.activities.LogSettingActivity @Module @Suppress("unused") abstract class ActivitiesModule { @ContributesAndroidInjector abstract fun contributesHistoryBrowseActivity(): HistoryBrowseActivity - @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributesMainActivity(): MainActivity @ContributesAndroidInjector abstract fun contributesPreferencesActivity(): PreferencesActivity - @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index 53ae37b9a7..b69132a683 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -47,8 +47,6 @@ import javax.inject.Singleton ActivitiesModule::class, FragmentsModule::class, ReceiversModule::class, - ServicesModule::class, - WorkflowModule::class, // Gradle modules AutomationModule::class, @@ -66,6 +64,7 @@ import javax.inject.Singleton ValidatorsModule::class, PluginsSupportModule::class, SyncModule::class, + WorkflowModule::class, // pumps ComboModule::class, @@ -83,7 +82,6 @@ import javax.inject.Singleton OmnipodErosModule::class, PumpCommonModule::class, RileyLinkModule::class - ] ) interface AppComponent : AndroidInjector { diff --git a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt index cfc22eacf6..200b83579f 100644 --- a/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt @@ -1,16 +1,2 @@ package info.nightscout.androidaps.di -import dagger.Module -import dagger.android.ContributesAndroidInjector -import info.nightscout.plugins.general.persistentNotification.DummyService -import info.nightscout.core.services.AlarmSoundService -import info.nightscout.automation.services.LocationService - -@Module -@Suppress("unused") -abstract class ServicesModule { - - @ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService - @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService - @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService -} \ No newline at end of file diff --git a/core/main/src/main/java/info/nightscout/core/di/CoreModule.kt b/core/main/src/main/java/info/nightscout/core/di/CoreModule.kt index 5d49cc0571..627e0d0f24 100644 --- a/core/main/src/main/java/info/nightscout/core/di/CoreModule.kt +++ b/core/main/src/main/java/info/nightscout/core/di/CoreModule.kt @@ -5,11 +5,14 @@ import android.os.Build import android.telephony.SmsManager import dagger.Module import dagger.Provides +import dagger.android.ContributesAndroidInjector +import info.nightscout.core.services.AlarmSoundService @Module( includes = [ CoreDataClassesModule::class, - PreferencesModule::class + PreferencesModule::class, + ServicesModule::class ] ) open class CoreModule { diff --git a/core/main/src/main/java/info/nightscout/core/di/ServicesModule.kt b/core/main/src/main/java/info/nightscout/core/di/ServicesModule.kt new file mode 100644 index 0000000000..3debe1c342 --- /dev/null +++ b/core/main/src/main/java/info/nightscout/core/di/ServicesModule.kt @@ -0,0 +1,12 @@ +package info.nightscout.core.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.core.services.AlarmSoundService + +@Module +@Suppress("unused") +abstract class ServicesModule { + + @ContributesAndroidInjector abstract fun contributesAlarmSoundService(): AlarmSoundService +} \ No newline at end of file diff --git a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt b/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt index 0ce7e62d8e..e1d98ebc4e 100644 --- a/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt +++ b/plugins/automation/src/main/java/info/nightscout/automation/di/AutomationModule.kt @@ -28,6 +28,7 @@ import info.nightscout.automation.dialogs.ChooseTriggerDialog import info.nightscout.automation.dialogs.EditActionDialog import info.nightscout.automation.dialogs.EditEventDialog import info.nightscout.automation.dialogs.EditTriggerDialog +import info.nightscout.automation.services.LocationService import info.nightscout.automation.triggers.Trigger import info.nightscout.automation.triggers.TriggerAutosensValue import info.nightscout.automation.triggers.TriggerBTDevice @@ -102,6 +103,7 @@ abstract class AutomationModule { @ContributesAndroidInjector abstract fun actionStartTempTargetInjector(): ActionStartTempTarget @ContributesAndroidInjector abstract fun actionStopTempTargetInjector(): ActionStopTempTarget @ContributesAndroidInjector abstract fun actionDummyInjector(): ActionDummy + @ContributesAndroidInjector abstract fun contributesLocationService(): LocationService @Module interface Bindings { diff --git a/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt b/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt index 3cdcc89d70..96ed5007e9 100644 --- a/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt +++ b/plugins/configuration/src/main/java/info/nightscout/configuration/di/ConfigurationModule.kt @@ -4,12 +4,14 @@ import dagger.Binds import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.configuration.AndroidPermissionImpl +import info.nightscout.configuration.activities.SingleFragmentActivity import info.nightscout.configuration.configBuilder.ConfigBuilderFragment import info.nightscout.configuration.configBuilder.ConfigBuilderPlugin import info.nightscout.configuration.configBuilder.RunningConfigurationImpl import info.nightscout.configuration.maintenance.ImportExportPrefsImpl import info.nightscout.configuration.maintenance.MaintenanceFragment import info.nightscout.configuration.maintenance.PrefFileListProviderImpl +import info.nightscout.configuration.maintenance.activities.LogSettingActivity import info.nightscout.configuration.maintenance.activities.PrefImportListActivity import info.nightscout.configuration.maintenance.formats.EncryptedPrefsFormat import info.nightscout.interfaces.AndroidPermission @@ -26,6 +28,8 @@ import info.nightscout.interfaces.maintenance.PrefFileListProvider ) abstract class ConfigurationModule { + @ContributesAndroidInjector abstract fun contributesSingleFragmentActivity(): SingleFragmentActivity + @ContributesAndroidInjector abstract fun contributesLogSettingActivity(): LogSettingActivity @ContributesAndroidInjector abstract fun contributesMaintenanceFragment(): MaintenanceFragment @ContributesAndroidInjector abstract fun contributesConfigBuilderFragment(): ConfigBuilderFragment @ContributesAndroidInjector abstract fun contributesCsvExportWorker(): ImportExportPrefsImpl.CsvExportWorker diff --git a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt index 91d0b084c0..3d20e2e34a 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/di/PluginsModule.kt @@ -5,6 +5,7 @@ import dagger.Module import dagger.android.ContributesAndroidInjector import info.nightscout.interfaces.iob.IobCobCalculator import info.nightscout.interfaces.smsCommunicator.SmsCommunicator +import info.nightscout.plugins.general.persistentNotification.DummyService import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.plugins.general.wear.WearFragment import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin @@ -31,6 +32,7 @@ import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin abstract class PluginsModule { @ContributesAndroidInjector abstract fun contributesWearFragment(): WearFragment + @ContributesAndroidInjector abstract fun contributesDummyService(): DummyService @Module interface Bindings {