fix: f-droid build warnings
This commit is contained in:
parent
6c30c6bae6
commit
413b9a37df
|
@ -30,6 +30,14 @@ android {
|
|||
vectorDrawables {
|
||||
useSupportLibrary = true
|
||||
}
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments += mapOf(
|
||||
"room.schemaLocation" to "$projectDir/schemas",
|
||||
"room.incremental" to "true"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
|
@ -6,7 +6,7 @@ import androidx.room.TypeConverters
|
|||
import com.zaneschepke.wireguardautotunnel.repository.model.Settings
|
||||
import com.zaneschepke.wireguardautotunnel.repository.model.TunnelConfig
|
||||
|
||||
@Database(entities = [Settings::class, TunnelConfig::class], version = 1)
|
||||
@Database(entities = [Settings::class, TunnelConfig::class], version = 1, exportSchema = true)
|
||||
@TypeConverters(DatabaseListConverters::class)
|
||||
abstract class AppDatabase : RoomDatabase() {
|
||||
abstract fun settingDao(): SettingsDoa
|
||||
|
|
|
@ -81,13 +81,18 @@ class TunnelControlTile : TileService() {
|
|||
private suspend fun determineTileTunnel() : TunnelConfig? {
|
||||
var tunnelConfig : TunnelConfig? = null;
|
||||
val settings = settingsRepo.getAll()
|
||||
if (!settings.isNullOrEmpty()) {
|
||||
if (settings.isNotEmpty()) {
|
||||
val setting = settings.first()
|
||||
tunnelConfig = if (setting.defaultTunnel != null) {
|
||||
TunnelConfig.from(setting.defaultTunnel!!);
|
||||
} else {
|
||||
val config = configRepo.getAll()?.first();
|
||||
config;
|
||||
val configs = configRepo.getAll();
|
||||
val config = if(configs.isNotEmpty()) {
|
||||
configs.first();
|
||||
} else {
|
||||
null
|
||||
}
|
||||
config
|
||||
}
|
||||
}
|
||||
return tunnelConfig;
|
||||
|
@ -97,7 +102,7 @@ class TunnelControlTile : TileService() {
|
|||
private fun attemptWatcherServiceToggle(tunnelConfig : String) {
|
||||
scope.launch {
|
||||
val settings = settingsRepo.getAll()
|
||||
if (!settings.isNullOrEmpty()) {
|
||||
if (settings.isNotEmpty()) {
|
||||
val setting = settings.first()
|
||||
if(setting.isAutoTunnelEnabled) {
|
||||
ServiceManager.toggleWatcherServiceForeground(this@TunnelControlTile, tunnelConfig)
|
||||
|
|
Loading…
Reference in New Issue