diff --git a/build-logic/convention/src/main/kotlin/common/SdkVersions.kt b/build-logic/convention/src/main/kotlin/common/SdkVersions.kt index 21dfb26f49..c206b122b1 100644 --- a/build-logic/convention/src/main/kotlin/common/SdkVersions.kt +++ b/build-logic/convention/src/main/kotlin/common/SdkVersions.kt @@ -5,7 +5,7 @@ import org.gradle.api.JavaVersion object SdkVersions { const val MIN = 23 - const val TARGET = 34 + const val TARGET = 35 val JAVA_TARGET = JavaVersion.VERSION_17 } diff --git a/feature/orchestrator/src/main/res/layout/activity_orchestrator.xml b/feature/orchestrator/src/main/res/layout/activity_orchestrator.xml index d28450dc20..9f437ce57a 100644 --- a/feature/orchestrator/src/main/res/layout/activity_orchestrator.xml +++ b/feature/orchestrator/src/main/res/layout/activity_orchestrator.xml @@ -2,7 +2,8 @@ + android:layout_height="match_parent" + android:fitsSystemWindows="true"> = Build.VERSION_CODES.O) { val chan = NotificationChannel( @@ -69,11 +80,17 @@ class EventDownSyncResetService : Service() { .setPriority(NotificationManager.IMPORTANCE_LOW) .setCategory(Notification.CATEGORY_SERVICE) .build() - // if runtime >= Q then use FOREGROUND_SERVICE_TYPE_DATA_SYNC - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC) - } else { - startForeground(1, notification) + + when { + // In Android 15 dataSync type might be timed out/restricted + // while shortService ensures that it will always be executed + Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE -> + startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE) + // Starting from Android 10 foreground services must declare type + Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q -> + startForeground(1, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC) + + else -> startForeground(1, notification) } } } diff --git a/infra/core/src/main/java/com/simprints/core/tools/extentions/Context.ext.kt b/infra/core/src/main/java/com/simprints/core/tools/extentions/Context.ext.kt index 7c2bef751a..ae10351e37 100644 --- a/infra/core/src/main/java/com/simprints/core/tools/extentions/Context.ext.kt +++ b/infra/core/src/main/java/com/simprints/core/tools/extentions/Context.ext.kt @@ -15,7 +15,7 @@ val Context.deviceHardwareId: String @ExcludedFromGeneratedTestCoverageReports("UI code") val Context.packageVersionName: String get() = try { - packageManager.getPackageInfo(packageName, 0).versionName + packageManager.getPackageInfo(packageName, 0).versionName ?: "" } catch (e: PackageManager.NameNotFoundException) { "Version Name Not Found" }