mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
80a02382e1
- add ktlint
22 lines
535 B
Kotlin
22 lines
535 B
Kotlin
package com.zaneschepke.wireguardautotunnel.data
|
|
|
|
import androidx.room.RoomDatabase
|
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
|
import timber.log.Timber
|
|
|
|
class DatabaseCallback : RoomDatabase.Callback() {
|
|
override fun onCreate(db: SupportSQLiteDatabase) = db.run {
|
|
// Notice non-ui thread is here
|
|
beginTransaction()
|
|
try {
|
|
execSQL(Queries.createDefaultSettings())
|
|
Timber.i("Bootstrapping settings data")
|
|
setTransactionSuccessful()
|
|
} catch (e: Exception) {
|
|
Timber.e(e)
|
|
} finally {
|
|
endTransaction()
|
|
}
|
|
}
|
|
}
|