Skip to content

Colota - Android GPS Location tracker

fix: disable stationary GPS pause by default (#244)

Max Dietrichfa4d437a791e
diff --git a/apps/mobile/android/app/src/main/java/com/colota/service/ServiceConfig.kt b/apps/mobile/android/app/src/main/java/com/colota/service/ServiceConfig.kt
index af1f3d33..6223347a 100644
--- a/apps/mobile/android/app/src/main/java/com/colota/service/ServiceConfig.kt
+++ b/apps/mobile/android/app/src/main/java/com/colota/service/ServiceConfig.kt
@@ -26,7 +26,7 @@ data class ServiceConfig(
val retryIntervalSeconds: Int = 30,
val isOfflineMode: Boolean = false,
val isWifiOnlySync: Boolean = false,
- val pauseWhenStationary: Boolean = true,
+ val pauseWhenStationary: Boolean = false,
val fieldMap: String? = null,
val customFields: String? = null,
val httpMethod: String = "POST",
@@ -50,7 +50,7 @@ data class ServiceConfig(
retryIntervalSeconds = saved["retryInterval"]?.toIntOrNull() ?: 30,
isOfflineMode = saved["isOfflineMode"]?.toBoolean() ?: false,
isWifiOnlySync = saved["isWifiOnlySync"]?.toBoolean() ?: false,
- pauseWhenStationary = saved["pauseWhenStationary"]?.toBoolean() ?: true,
+ pauseWhenStationary = saved["pauseWhenStationary"]?.toBoolean() ?: false,
fieldMap = saved["fieldMap"],
customFields = saved["customFields"],
httpMethod = httpMethod,
diff --git a/apps/mobile/src/contexts/TrackingProvider.tsx b/apps/mobile/src/contexts/TrackingProvider.tsx
index 21b655c0..d463e0ba 100644
--- a/apps/mobile/src/contexts/TrackingProvider.tsx
+++ b/apps/mobile/src/contexts/TrackingProvider.tsx
@@ -54,7 +54,7 @@ function parseRawSettings(allRaw: Record<string, string>): Settings {
isOfflineMode: allRaw.isOfflineMode === "true",
isWifiOnlySync: allRaw.isWifiOnlySync === "true",
- pauseWhenStationary: allRaw.pauseWhenStationary !== "false",
+ pauseWhenStationary: allRaw.pauseWhenStationary === "true",
endpoint: allRaw.endpoint ?? DEFAULT_SETTINGS.endpoint,
syncPreset: (allRaw.syncPreset as any) ?? DEFAULT_SETTINGS.syncPreset,
filterInaccurateLocations: allRaw.filterInaccurateLocations === "true",
diff --git a/apps/mobile/src/types/global.ts b/apps/mobile/src/types/global.ts
index 11ad1a4d..08bb2404 100644
--- a/apps/mobile/src/types/global.ts
+++ b/apps/mobile/src/types/global.ts
@@ -311,7 +311,7 @@ export const DEFAULT_SETTINGS: Settings = {
maxRetries: 5,
isOfflineMode: false,
isWifiOnlySync: false,
- pauseWhenStationary: true,
+ pauseWhenStationary: false,
hasCompletedSetup: false,
httpMethod: "POST"
} as const