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