I now found a solution. I don't know if it is the right way, but it works.
@Module
@InstallIn(SingletonComponent::class)
object AlarmModule {
@Provides
@Singleton
fun provideAddDayReminderNotificationSingleton(
notificationUseCases: NotificationUseCases,
dayUseCases: DayUseCases
): AddDayReminderNotification {
return AddDayReminderNotification(notificationUseCases, dayUseCases)
}
}
@AndroidEntryPoint
class AlarmReceiver : BroadcastReceiver() {
@Inject
lateinit var addDayReminderNotificationSingleton: AddDayReminderNotification
...
}
@Singleton
class AddDayReminderNotification(
private val notificationUseCases: NotificationUseCases,
private val dayUseCases: DayUseCases
) {
...
}