AAPSLogger -> core
This commit is contained in:
parent
99907ed029
commit
5be4a5dd97
|
@ -12,8 +12,6 @@ import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
|||
import info.nightscout.androidaps.interfaces.CommandQueueProvider
|
||||
import info.nightscout.androidaps.interfaces.PluginBase
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.AAPSLoggerProduction
|
||||
import info.nightscout.androidaps.logging.L
|
||||
import info.nightscout.androidaps.plugins.configBuilder.PluginStore
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunction
|
||||
import info.nightscout.androidaps.plugins.configBuilder.ProfileFunctionImplementation
|
||||
|
@ -34,10 +32,6 @@ open class AppModule {
|
|||
return ProfileFunctionImplementation(injector, aapsLogger, sp, resourceHelper, activePlugin, fabricPrivacy)
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAAPSLogger(l: L): AAPSLogger = AAPSLoggerProduction(l)
|
||||
|
||||
@Provides
|
||||
fun providesPlugins(@PluginsModule.AllConfigs allConfigs: Map<@JvmSuppressWildcards Int, @JvmSuppressWildcards PluginBase>,
|
||||
@PluginsModule.PumpDriver pumpDrivers: Lazy<Map<@JvmSuppressWildcards Int, @JvmSuppressWildcards PluginBase>>,
|
||||
|
@ -64,10 +58,7 @@ open class AppModule {
|
|||
|
||||
@Binds fun bindContext(mainApp: MainApp): Context
|
||||
@Binds fun bindInjector(mainApp: MainApp): HasAndroidInjector
|
||||
|
||||
@Binds
|
||||
fun bindActivePluginProvider(pluginStore: PluginStore): ActivePluginProvider
|
||||
|
||||
@Binds fun bindActivePluginProvider(pluginStore: PluginStore): ActivePluginProvider
|
||||
@Binds fun commandQueueProvider(commandQueue: CommandQueue): CommandQueueProvider
|
||||
|
||||
}
|
||||
|
|
|
@ -51,6 +51,8 @@ dependencies {
|
|||
kapt "com.google.dagger:dagger-android-processor:$dagger_version"
|
||||
kapt "com.google.dagger:dagger-compiler:$dagger_version"
|
||||
|
||||
implementation 'org.slf4j:slf4j-api:1.7.30'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
|
|
@ -4,6 +4,9 @@ import android.content.Context
|
|||
import android.preference.PreferenceManager
|
||||
import dagger.Module
|
||||
import dagger.Provides
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.AAPSLoggerProduction
|
||||
import info.nightscout.androidaps.logging.L
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelperImplementation
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
|
@ -15,13 +18,14 @@ open class CoreModule {
|
|||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideResources(context: Context): ResourceHelper {
|
||||
return ResourceHelperImplementation(context)
|
||||
}
|
||||
fun provideResources(context: Context): ResourceHelper = ResourceHelperImplementation(context)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideSharedPreferences(context: Context, resourceHelper: ResourceHelper): SP {
|
||||
return SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), resourceHelper)
|
||||
}
|
||||
fun provideSharedPreferences(context: Context, resourceHelper: ResourceHelper): SP = SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), resourceHelper)
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
fun provideAAPSLogger(l: L): AAPSLogger = AAPSLoggerProduction(l)
|
||||
|
||||
}
|
|
@ -1,7 +1,5 @@
|
|||
package info.nightscout.androidaps.logging
|
||||
|
||||
import androidx.preference.PreferenceManager
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
Loading…
Reference in a new issue