From 15fe0b7cc1ccc6df4efa24ab29bfb4acc121bcb1 Mon Sep 17 00:00:00 2001 From: andrekir Date: Thu, 20 Jul 2023 18:27:39 -0300 Subject: [PATCH] refactor: change FusedLocationProvider interval to 30s --- .../mesh/repository/location/SharedLocationManager.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/google/java/com/geeksville/mesh/repository/location/SharedLocationManager.kt b/app/src/google/java/com/geeksville/mesh/repository/location/SharedLocationManager.kt index 14d736dd5..60a3a3bb9 100644 --- a/app/src/google/java/com/geeksville/mesh/repository/location/SharedLocationManager.kt +++ b/app/src/google/java/com/geeksville/mesh/repository/location/SharedLocationManager.kt @@ -36,13 +36,13 @@ class SharedLocationManager constructor( private val _receivingLocationUpdates: MutableStateFlow = MutableStateFlow(false) val receivingLocationUpdates: StateFlow get() = _receivingLocationUpdates - private val desiredInterval = 1 * 60 * 1000L + private val desiredInterval = 30 * 1000L // 30 seconds // Set up the Fused Location Provider and LocationRequest private val fusedLocationClient = LocationServices.getFusedLocationProviderClient(context) private val locationRequest = LocationRequest.Builder(desiredInterval) - .setMinUpdateIntervalMillis(30 * 1000L) - .setMaxUpdateDelayMillis(5 * 60 * 1000L) + // .setMinUpdateIntervalMillis(10 * 1000L) + // .setMaxUpdateDelayMillis(5 * 60 * 1000L) // .setMinUpdateDistanceMeters(30f) // 30 meters .setPriority(Priority.PRIORITY_BALANCED_POWER_ACCURACY) .build()