Inform the user when the location provider is disabled.

This commit is contained in:
Benoit Marty 2022-01-27 16:23:39 +01:00
parent 7242f1c2f1
commit db3f60b4b1
1 changed files with 4 additions and 0 deletions

View File

@ -83,6 +83,10 @@ class LocationTracker @Inject constructor(
callback?.onLocationUpdate(location.toLocationData()) callback?.onLocationUpdate(location.toLocationData())
} }
override fun onProviderDisabled(provider: String) {
callback?.onLocationProviderIsNotAvailable()
}
private fun Location.toLocationData(): LocationData { private fun Location.toLocationData(): LocationData {
return LocationData(latitude, longitude, accuracy.toDouble()) return LocationData(latitude, longitude, accuracy.toDouble())
} }