mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-02-17 12:00:39 +01:00
do not use writeAheadLogging and custom executor at the Room database
This commit is contained in:
parent
e3b0caa577
commit
e976c72cd9
@ -14,7 +14,6 @@ import com.simplemobiletools.contacts.pro.interfaces.ContactsDao
|
|||||||
import com.simplemobiletools.contacts.pro.interfaces.GroupsDao
|
import com.simplemobiletools.contacts.pro.interfaces.GroupsDao
|
||||||
import com.simplemobiletools.contacts.pro.models.Group
|
import com.simplemobiletools.contacts.pro.models.Group
|
||||||
import com.simplemobiletools.contacts.pro.models.LocalContact
|
import com.simplemobiletools.contacts.pro.models.LocalContact
|
||||||
import com.simplemobiletools.contacts.pro.objects.MyExecutor
|
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|
||||||
@Database(entities = [LocalContact::class, Group::class], version = 1)
|
@Database(entities = [LocalContact::class, Group::class], version = 1)
|
||||||
@ -33,7 +32,6 @@ abstract class ContactsDatabase : RoomDatabase() {
|
|||||||
synchronized(ContactsDatabase::class) {
|
synchronized(ContactsDatabase::class) {
|
||||||
if (db == null) {
|
if (db == null) {
|
||||||
db = Room.databaseBuilder(context.applicationContext, ContactsDatabase::class.java, "local_contacts.db")
|
db = Room.databaseBuilder(context.applicationContext, ContactsDatabase::class.java, "local_contacts.db")
|
||||||
.setQueryExecutor(MyExecutor.myExecutor)
|
|
||||||
.addCallback(object : Callback() {
|
.addCallback(object : Callback() {
|
||||||
override fun onCreate(db: SupportSQLiteDatabase) {
|
override fun onCreate(db: SupportSQLiteDatabase) {
|
||||||
super.onCreate(db)
|
super.onCreate(db)
|
||||||
@ -41,7 +39,6 @@ abstract class ContactsDatabase : RoomDatabase() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
db!!.openHelper.setWriteAheadLoggingEnabled(true)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
package com.simplemobiletools.contacts.pro.objects
|
|
||||||
|
|
||||||
import java.util.concurrent.Executors
|
|
||||||
|
|
||||||
object MyExecutor {
|
|
||||||
val myExecutor = Executors.newSingleThreadExecutor()
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user