File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
src/main/java/com/duckduckgo/downloads/impl/di Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ dependencies {
4343 implementation project(path : ' :statistics-api' )
4444 implementation project(path : ' :app-build-config-api' )
4545 implementation project(path : ' :downloads-store' )
46+ implementation project(path : ' :data-store-api' )
4647
4748 implementation AndroidX . core. ktx
4849
Original file line number Diff line number Diff line change 1616
1717package com.duckduckgo.downloads.impl.di
1818
19- import android.content.Context
20- import androidx.room.Room
19+ import com.duckduckgo.data.store.api.DatabaseProvider
20+ import com.duckduckgo.data.store.api.RoomDatabaseConfig
2121import com.duckduckgo.di.scopes.AppScope
2222import com.duckduckgo.downloads.store.DownloadsDatabase
2323import com.squareup.anvil.annotations.ContributesTo
@@ -31,9 +31,13 @@ class DownloadsModule {
3131
3232 @Provides
3333 @SingleInstanceIn(AppScope ::class )
34- fun provideDownloadsDatabase (context : Context ): DownloadsDatabase {
35- return Room .databaseBuilder(context, DownloadsDatabase ::class .java, " downloads.db" )
36- .fallbackToDestructiveMigration()
37- .build()
34+ fun provideDownloadsDatabase (databaseProvider : DatabaseProvider ): DownloadsDatabase {
35+ return databaseProvider.buildRoomDatabase(
36+ DownloadsDatabase ::class .java,
37+ " downloads.db" ,
38+ config = RoomDatabaseConfig (
39+ fallbackToDestructiveMigration = true ,
40+ ),
41+ )
3842 }
3943}
You can’t perform that action at this time.
0 commit comments