Skip to content

Commit

Permalink
Fix location provider (#912)
Browse files Browse the repository at this point in the history
Co-authored-by: ialokim <[email protected]>
  • Loading branch information
Altonss and ialokim authored Jan 13, 2024
1 parent 933b152 commit 29821e4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ import java.util.concurrent.TimeUnit

@RequiresPermission(ACCESS_FINE_LOCATION)
override fun onActive() {
for (provider in LOCATION_PROVIDERS) {
for (provider in LOCATION_PROVIDERS.filter(locationManager::isProviderEnabled)) {
locationManager.requestLocationUpdates(provider, MIN_UPDATE_INTERVAL, MIN_UPDATE_DISTANCE, this, Looper.getMainLooper())
}
}

@RequiresPermission(ACCESS_FINE_LOCATION)
override fun onInactive() {
for (provider in LOCATION_PROVIDERS) {
locationManager.removeUpdates(this)
}
locationManager.removeUpdates(this)
}

override fun onLocationChanged(location: Location) {
Expand Down

0 comments on commit 29821e4

Please sign in to comment.