mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Use SqliteDatabase as default implementation.
This commit is contained in:
@@ -24,7 +24,7 @@ public class DatabaseModule {
|
|||||||
@Singleton
|
@Singleton
|
||||||
Database<Connection> provideDatabase(DatabaseConfig config,
|
Database<Connection> provideDatabase(DatabaseConfig config,
|
||||||
MessageFactory messageFactory, Clock clock) {
|
MessageFactory messageFactory, Clock clock) {
|
||||||
return new H2Database(config, messageFactory, clock);
|
return new SqliteDatabase(config, messageFactory, clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@@ -150,7 +150,8 @@ public class AppModule {
|
|||||||
//FIXME: StrictMode
|
//FIXME: StrictMode
|
||||||
StrictMode.ThreadPolicy tp = StrictMode.allowThreadDiskReads();
|
StrictMode.ThreadPolicy tp = StrictMode.allowThreadDiskReads();
|
||||||
StrictMode.allowThreadDiskWrites();
|
StrictMode.allowThreadDiskWrites();
|
||||||
File dbDir = app.getApplicationContext().getDir("db", MODE_PRIVATE);
|
File dbDir = app.getApplicationContext().getDir("db_sqlite",
|
||||||
|
MODE_PRIVATE);
|
||||||
File keyDir = app.getApplicationContext().getDir("key", MODE_PRIVATE);
|
File keyDir = app.getApplicationContext().getDir("key", MODE_PRIVATE);
|
||||||
StrictMode.setThreadPolicy(tp);
|
StrictMode.setThreadPolicy(tp);
|
||||||
KeyStrengthener keyStrengthener = SDK_INT >= 23
|
KeyStrengthener keyStrengthener = SDK_INT >= 23
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ internal class HeadlessModule(private val appDir: File) {
|
|||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
internal fun provideDatabaseConfig(): DatabaseConfig {
|
internal fun provideDatabaseConfig(): DatabaseConfig {
|
||||||
val dbDir = File(appDir, "db")
|
val dbDir = File(appDir, "db_sqlite")
|
||||||
val keyDir = File(appDir, "key")
|
val keyDir = File(appDir, "key")
|
||||||
return HeadlessDatabaseConfig(dbDir, keyDir)
|
return HeadlessDatabaseConfig(dbDir, keyDir)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ internal class HeadlessTestModule(private val appDir: File) {
|
|||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
internal fun provideDatabaseConfig(): DatabaseConfig {
|
internal fun provideDatabaseConfig(): DatabaseConfig {
|
||||||
val dbDir = File(appDir, "db")
|
val dbDir = File(appDir, "db_sqlite")
|
||||||
val keyDir = File(appDir, "key")
|
val keyDir = File(appDir, "key")
|
||||||
return HeadlessDatabaseConfig(dbDir, keyDir)
|
return HeadlessDatabaseConfig(dbDir, keyDir)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user