Loading cardinal-android/app/src/main/java/earth/maps/cardinal/data/LocationRepository.kt +3 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class LocationRepository @Inject constructor( private companion object { private const val LOCATION_REQUEST_INTERVAL_MS = 15000L // 15 seconds private const val LOCATION_REQUEST_TIMEOUT_MS = 10000L // 10 seconds private const val LOCATION_REQUEST_TIMEOUT_MS = 5000L // 5 seconds private const val CONTINUOUS_LOCATION_UPDATE_INTERVAL_MS = 5000L // 5 seconds private const val CONTINUOUS_LOCATION_UPDATE_DISTANCE_M = 5f // 5 meters private const val FUSED_PROVIDER_TIMEOUT_MS = Loading Loading @@ -458,13 +458,14 @@ class LocationRepository @Inject constructor( ) { kotlinx.coroutines.MainScope().launch { kotlinx.coroutines.delay(LOCATION_REQUEST_TIMEOUT_MS) val lastKnownLocation = getLastKnownLocation(locationManager) if (locationDeferred.isActive) { try { locationManager.removeUpdates(locationListener) } catch (_: Exception) { // Ignore exceptions during cleanup } locationDeferred.complete(null) locationDeferred.complete(lastKnownLocation) } } } Loading Loading
cardinal-android/app/src/main/java/earth/maps/cardinal/data/LocationRepository.kt +3 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ class LocationRepository @Inject constructor( private companion object { private const val LOCATION_REQUEST_INTERVAL_MS = 15000L // 15 seconds private const val LOCATION_REQUEST_TIMEOUT_MS = 10000L // 10 seconds private const val LOCATION_REQUEST_TIMEOUT_MS = 5000L // 5 seconds private const val CONTINUOUS_LOCATION_UPDATE_INTERVAL_MS = 5000L // 5 seconds private const val CONTINUOUS_LOCATION_UPDATE_DISTANCE_M = 5f // 5 meters private const val FUSED_PROVIDER_TIMEOUT_MS = Loading Loading @@ -458,13 +458,14 @@ class LocationRepository @Inject constructor( ) { kotlinx.coroutines.MainScope().launch { kotlinx.coroutines.delay(LOCATION_REQUEST_TIMEOUT_MS) val lastKnownLocation = getLastKnownLocation(locationManager) if (locationDeferred.isActive) { try { locationManager.removeUpdates(locationListener) } catch (_: Exception) { // Ignore exceptions during cleanup } locationDeferred.complete(null) locationDeferred.complete(lastKnownLocation) } } } Loading