LocationProviderImpl

class LocationProviderImpl(context: Context, systemManager: SystemManager) : LocationProvider

Types

Companion
Link copied to clipboard
object Companion

Functions

currentLocation
Link copied to clipboard
open suspend override fun currentLocation(validate: Boolean): Completion<Location?>

Returns the current location from Fused Location Provider API or from LocationManager as fallback (getCurrentLocation or requestSingleUpdate depending on API level) If validate is set to true, it will only return the location if it is valid and null otherwise. In case of error it returns a Throwable.

firstValidLocation
Link copied to clipboard
open suspend override fun firstValidLocation(): Completion<Location>

Requests location updates from Fused Location Provider API or from LocationManager as fallback and returns the first valid Location or a Throwable.

lastKnownLocation
Link copied to clipboard
open suspend override fun lastKnownLocation(validate: Boolean): Completion<Location?>

Returns the last location from Fused Location Provider API or the last known location from LocationManager as fallback. If validate is set to true, it will only return the location if it is valid and null otherwise. In case of error it returns a Throwable.

removeLocationUpdates
Link copied to clipboard
open override fun removeLocationUpdates()
requestLocationUpdates
Link copied to clipboard
open override fun requestLocationUpdates()

Properties

location
Link copied to clipboard
open override val location: MutableLiveData<Location>
locationState
Link copied to clipboard
open override val locationState: LiveData<LocationState>