From e3fca5bc6fdabb3ef350b0bb9fdcaa71cb078b9f Mon Sep 17 00:00:00 2001 From: Dmitriy Krivoruchko Date: Sat, 5 Dec 2020 16:00:18 +0200 Subject: [PATCH] Bug fixes --- app/build.gradle | 6 +++--- .../kotlin/info/dvkr/screenstream/service/AppService.kt | 4 +++- .../info/dvkr/screenstream/service/helper/IntentAction.kt | 5 ++++- app/src/main/res/{values-cat => values-ca}/strings.xml | 0 data/build.gradle | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) rename app/src/main/res/{values-cat => values-ca}/strings.xml (100%) diff --git a/app/build.gradle b/app/build.gradle index 4f754c7f..e2380af2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,9 +12,9 @@ android { applicationId = "info.dvkr.screenstream" minSdkVersion(21) targetSdkVersion(30) - versionCode = 30502 - versionName = "3.5.2" - resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "cat") + versionCode = 30503 + versionName = "3.5.3" + resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "ca") vectorDrawables.useSupportLibrary = true } diff --git a/app/src/main/kotlin/info/dvkr/screenstream/service/AppService.kt b/app/src/main/kotlin/info/dvkr/screenstream/service/AppService.kt index 268cbd48..32e74849 100644 --- a/app/src/main/kotlin/info/dvkr/screenstream/service/AppService.kt +++ b/app/src/main/kotlin/info/dvkr/screenstream/service/AppService.kt @@ -37,7 +37,9 @@ class AppService : Service() { fun getAppServiceIntent(context: Context): Intent = Intent(context.applicationContext, AppService::class.java) - fun startForeground(context: Context, intent: Intent) = context.startService(intent) + fun startService(context: Context, intent: Intent) = context.startService(intent) + + fun startForeground(context: Context, intent: Intent) = ContextCompat.startForegroundService(context, intent) } inner class AppServiceBinder : Binder() { diff --git a/app/src/main/kotlin/info/dvkr/screenstream/service/helper/IntentAction.kt b/app/src/main/kotlin/info/dvkr/screenstream/service/helper/IntentAction.kt index 26dbda9a..20c70c3b 100644 --- a/app/src/main/kotlin/info/dvkr/screenstream/service/helper/IntentAction.kt +++ b/app/src/main/kotlin/info/dvkr/screenstream/service/helper/IntentAction.kt @@ -25,7 +25,10 @@ sealed class IntentAction : Parcelable { fun sendToAppService(context: Context) { XLog.i(context.getLog("sendToAppService", this.toString())) - AppService.startForeground(context, this.toAppServiceIntent(context)) + if (this is StartOnBoot) + AppService.startForeground(context, this.toAppServiceIntent(context)) + else + AppService.startService(context, this.toAppServiceIntent(context)) } @Parcelize object GetServiceState : IntentAction() diff --git a/app/src/main/res/values-cat/strings.xml b/app/src/main/res/values-ca/strings.xml similarity index 100% rename from app/src/main/res/values-cat/strings.xml rename to app/src/main/res/values-ca/strings.xml diff --git a/data/build.gradle b/data/build.gradle index bc31131b..8996dbc9 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion(21) targetSdkVersion(30) - versionCode = 30502 - versionName = "3.5.2" + versionCode = 30503 + versionName = "3.5.3" } compileOptions {