Skip to content

Commit

Permalink
Replace deprecated way of initializing LocationRequest with recommend…
Browse files Browse the repository at this point in the history
…ed approach (#2970)
  • Loading branch information
anandwana001 authored Jan 2, 2025
1 parent e38b294 commit bc65fe4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.google.android.ground.system

import android.location.Location
import com.google.android.gms.location.LocationRequest
import com.google.android.gms.location.Priority
import com.google.android.ground.coroutines.ApplicationScope
import com.google.android.ground.system.channel.LocationSharedFlowCallback
import javax.inject.Inject
Expand All @@ -30,10 +31,9 @@ private const val UPDATE_INTERVAL: Long = 1000 /* 1 sec */
private const val FASTEST_INTERVAL: Long = 250 /* 250 ms */

val FINE_LOCATION_UPDATES_REQUEST: LocationRequest =
LocationRequest()
.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)
.setInterval(UPDATE_INTERVAL)
.setFastestInterval(FASTEST_INTERVAL)
LocationRequest.Builder(Priority.PRIORITY_BALANCED_POWER_ACCURACY, UPDATE_INTERVAL)
.apply { setMinUpdateIntervalMillis(FASTEST_INTERVAL) }
.build()

@Singleton
class LocationManager
Expand Down

0 comments on commit bc65fe4

Please sign in to comment.