LocationManager

Class of android.location · LocationManager.java · Android's reference

public class LocationManager

The location service of a device with location turned off: the standard providers exist, none is enabled, no fix is known, and no update comes. The device has no GNSS chip, so GNSS callbacks are not supported.

Fields

public static final String GPS_PROVIDER = "gps" source
public static final String NETWORK_PROVIDER = "network" source
public static final String PASSIVE_PROVIDER = "passive" source
public static final String FUSED_PROVIDER = "fused" source
public static final String KEY_LOCATION_CHANGED = "location" source
public static final String KEY_PROVIDER_ENABLED = "providerEnabled" source
public static final String KEY_STATUS_CHANGED = "status" source
public static final String KEY_FLUSH_COMPLETE = "flushComplete" source
public static final String KEY_LOCATIONS = "locations" source
public static final String MODE_CHANGED_ACTION = "android.location.MODE_CHANGED" source
public static final String PROVIDERS_CHANGED_ACTION = "android.location.PROVIDERS_CHANGED" source
public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME" source
public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED" source
public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED" source

Constructors

public LocationManager() empty body source

Methods

public List<String> getAllProviders() source
public List<String> getProviders(boolean enabledOnly) source
public boolean hasProvider(String provider) source
public LocationProvider getProvider(String name) source
public boolean isLocationEnabled() source
public boolean isProviderEnabled(String provider) source
public Location getLastKnownLocation(String provider) source
public void getCurrentLocation(String provider, CancellationSignal cancellationSignal, Executor executor, Consumer<Location> consumer) source

No fix can come, so the consumer takes null.

public void requestLocationUpdates(String provider, long minTimeMs, float minDistanceM, LocationListener listener, Looper looper) source

The provider is off: the listener hears that, and no update.

public void requestLocationUpdates(String provider, long minTimeMs, float minDistanceM, LocationListener listener) source
public void requestLocationUpdates(String provider, long minTimeMs, float minDistanceM, Executor executor, LocationListener listener) source
public void requestLocationUpdates(String provider, LocationRequest locationRequest, Executor executor, LocationListener listener) source
public void removeUpdates(LocationListener listener) empty body source
public String getGnssHardwareModelName() source
public int getGnssYearOfHardware() source
public boolean registerGnssStatusCallback(GnssStatus.Callback callback, Handler handler) source
public boolean registerGnssStatusCallback(Executor executor, GnssStatus.Callback callback) source
public void unregisterGnssStatusCallback(GnssStatus.Callback callback) empty body source
public boolean registerGnssMeasurementsCallback(GnssMeasurementsEvent.Callback callback, Handler handler) source
public boolean registerGnssMeasurementsCallback(Executor executor, GnssMeasurementsEvent.Callback callback) source
public void unregisterGnssMeasurementsCallback(GnssMeasurementsEvent.Callback callback) empty body source
public boolean addGpsStatusListener(GpsStatus.Listener listener) deprecated source
public void removeGpsStatusListener(GpsStatus.Listener listener) empty body deprecated source
public GpsStatus getGpsStatus(GpsStatus status) deprecated source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.