Skip to content

Commit

Permalink
Make DefaultMdmService a singleton and use Binds instead of Provides.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Dec 4, 2023
1 parent 882020f commit 6452b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6452b5c

Please sign in to comment.