Make DefaultMdmService a singleton and use Binds instead of Provides.
This commit is contained in:
parent
882020fdba
commit
6452b5c2b4
|
@ -111,6 +111,9 @@ import javax.inject.Singleton
|
|||
@Binds
|
||||
abstract fun bindEmojiSpanify(emojiCompatWrapper: EmojiCompatWrapper): EmojiSpanify
|
||||
|
||||
@Binds
|
||||
abstract fun bindMdmService(service: DefaultMdmService): MdmService
|
||||
|
||||
@Binds
|
||||
abstract fun bindFontScale(fontScale: FontScalePreferencesImpl): FontScalePreferences
|
||||
|
||||
|
@ -173,11 +176,6 @@ import javax.inject.Singleton
|
|||
return Matrix(context, configuration)
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun providesMdmService(context: Context): MdmService {
|
||||
return DefaultMdmService(context)
|
||||
}
|
||||
|
||||
@Provides
|
||||
fun providesCurrentSession(activeSessionHolder: ActiveSessionHolder): Session {
|
||||
// TODO handle session injection better
|
||||
|
|
|
@ -25,7 +25,9 @@ import androidx.core.content.getSystemService
|
|||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class DefaultMdmService @Inject constructor(
|
||||
@ApplicationContext applicationContext: Context
|
||||
) : MdmService {
|
||||
|
|
Loading…
Reference in New Issue