LocationManagerCompat
Helper for accessing features in LocationManager.
Functions
Link copied to clipboard
open fun getCurrentLocation(@NonNull locationManager: @NonNull LocationManager, @NonNull provider: @NonNull String, @Nullable cancellationSignal: @Nullable CancellationSignal, @NonNull executor: @NonNull Executor, @NonNull consumer: @NonNull Consumer<Location>)
open fun
Asynchronously returns a single current location fix from the given provider.
Link copied to clipboard
@Nullable
Returns the model name (including vendor and hardware/software version) of the GNSS hardware driver, or null if this information is not available.
Link copied to clipboard
Returns the model year of the GNSS hardware and software build, or 0 if the model year is before 2016.
Link copied to clipboard
open fun hasProvider(@NonNull locationManager: @NonNull LocationManager, @NonNull provider: @NonNull String): Boolean
Returns true if the given location provider exists on this device, irrespective of whether it is currently enabled or not.
Link copied to clipboard
Returns the current enabled/disabled state of location.
Link copied to clipboard
open fun registerGnssMeasurementsCallback(@NonNull locationManager: @NonNull LocationManager, callback: @NonNull GnssMeasurementsEvent.Callback, @NonNull handler: @NonNull Handler): Boolean
open fun registerGnssMeasurementsCallback(@NonNull locationManager: @NonNull LocationManager, @NonNull executor: @NonNull Executor, callback: @NonNull GnssMeasurementsEvent.Callback): Boolean
Registers a GNSS measurement callback.
Link copied to clipboard
open fun registerGnssStatusCallback(@NonNull locationManager: @NonNull LocationManager, callback: @NonNull GnssStatusCompat.Callback, @NonNull handler: @NonNull Handler): Boolean
open fun registerGnssStatusCallback(@NonNull locationManager: @NonNull LocationManager, @NonNull executor: @NonNull Executor, callback: @NonNull GnssStatusCompat.Callback): Boolean
Registers a platform agnostic GnssStatusCompat.Callback.
Link copied to clipboard
open fun removeUpdates(@NonNull locationManager: @NonNull LocationManager, @NonNull listener: @NonNull LocationListenerCompat)
Removes all location updates for the specified LocationListener.
Link copied to clipboard
open fun requestLocationUpdates(@NonNull locationManager: @NonNull LocationManager, @NonNull provider: @NonNull String, @NonNull locationRequest: @NonNull LocationRequestCompat, @NonNull listener: @NonNull LocationListenerCompat, @NonNull looper: @NonNull Looper)
Register for location updates from the specified provider, using a LocationRequestCompat, and a callback on the specified Looper.
open fun requestLocationUpdates(@NonNull locationManager: @NonNull LocationManager, @NonNull provider: @NonNull String, @NonNull locationRequest: @NonNull LocationRequestCompat, @NonNull executor: @NonNull Executor, @NonNull listener: @NonNull LocationListenerCompat)
Register for location updates from the specified provider, using a LocationRequestCompat, and a callback on the specified Executor.
Link copied to clipboard
open fun unregisterGnssMeasurementsCallback(@NonNull locationManager: @NonNull LocationManager, callback: @NonNull GnssMeasurementsEvent.Callback)
Unregisters a GNSS measurement callback.
Link copied to clipboard
open fun unregisterGnssStatusCallback(@NonNull locationManager: @NonNull LocationManager, callback: @NonNull GnssStatusCompat.Callback)
Unregisters a platform agnostic GnssStatusCompat.Callback.