public class LocationManagerService
extends ILocationManager.Stub
Modifier and Type | Field and Description |
---|---|
static boolean |
D |
Constructor and Description |
---|
LocationManagerService(Context context) |
Modifier and Type | Method and Description |
---|---|
boolean |
addGnssMeasurementsListener(IGnssMeasurementsListener listener,
String packageName) |
boolean |
addGnssNavigationMessageListener(IGnssNavigationMessageListener listener,
String packageName) |
void |
addTestProvider(String name,
ProviderProperties properties,
String opPackageName) |
void |
clearTestProviderEnabled(String provider,
String opPackageName) |
void |
clearTestProviderLocation(String provider,
String opPackageName) |
void |
clearTestProviderStatus(String provider,
String opPackageName) |
protected void |
dump(FileDescriptor fd,
PrintWriter pw,
String[] args) |
boolean |
geocoderIsPresent() |
List<String> |
getAllProviders()
Returns all providers by name, including passive, but excluding
fused, also including ones that are not permitted to
be accessed by the calling activity or are currently disabled.
|
String |
getBestProvider(Criteria criteria,
boolean enabledOnly)
Return the name of the best provider given a Criteria object.
|
String |
getFromLocation(double latitude,
double longitude,
int maxResults,
GeocoderParams params,
List<Address> addrs) |
String |
getFromLocationName(String locationName,
double lowerLeftLatitude,
double lowerLeftLongitude,
double upperRightLatitude,
double upperRightLongitude,
int maxResults,
GeocoderParams params,
List<Address> addrs) |
int |
getGnssYearOfHardware()
Returns the system information of the GNSS hardware.
|
Location |
getLastLocation(LocationRequest request,
String packageName) |
String |
getNetworkProviderPackage() |
ProviderProperties |
getProviderProperties(String provider) |
List<String> |
getProviders(Criteria criteria,
boolean enabledOnly)
Return all providers by name, that match criteria and are optionally
enabled.
|
boolean |
isProviderEnabled(String provider) |
void |
locationCallbackFinished(ILocationListener listener) |
boolean |
providerMeetsCriteria(String provider,
Criteria criteria) |
boolean |
registerGnssStatusCallback(IGnssStatusListener callback,
String packageName) |
void |
removeGeofence(Geofence geofence,
PendingIntent intent,
String packageName) |
void |
removeGnssMeasurementsListener(IGnssMeasurementsListener listener) |
void |
removeGnssNavigationMessageListener(IGnssNavigationMessageListener listener) |
void |
removeTestProvider(String provider,
String opPackageName) |
void |
removeUpdates(ILocationListener listener,
PendingIntent intent,
String packageName) |
void |
reportLocation(Location location,
boolean passive) |
void |
requestGeofence(LocationRequest request,
Geofence geofence,
PendingIntent intent,
String packageName) |
void |
requestLocationUpdates(LocationRequest request,
ILocationListener listener,
PendingIntent intent,
String packageName) |
static int |
resolutionLevelToOp(int allowedResolutionLevel) |
boolean |
sendExtraCommand(String provider,
String command,
Bundle extras) |
boolean |
sendNiResponse(int notifId,
int userResponse) |
void |
setTestProviderEnabled(String provider,
boolean enabled,
String opPackageName) |
void |
setTestProviderLocation(String provider,
Location loc,
String opPackageName) |
void |
setTestProviderStatus(String provider,
int status,
Bundle extras,
long updateTime,
String opPackageName) |
void |
systemRunning() |
void |
unregisterGnssStatusCallback(IGnssStatusListener callback) |
public LocationManagerService(Context context)
public void systemRunning()
public void locationCallbackFinished(ILocationListener listener)
public int getGnssYearOfHardware()
public static int resolutionLevelToOp(int allowedResolutionLevel)
public List<String> getAllProviders()
public List<String> getProviders(Criteria criteria, boolean enabledOnly)
public String getBestProvider(Criteria criteria, boolean enabledOnly)
public void requestLocationUpdates(LocationRequest request, ILocationListener listener, PendingIntent intent, String packageName)
public void removeUpdates(ILocationListener listener, PendingIntent intent, String packageName)
public Location getLastLocation(LocationRequest request, String packageName)
public void requestGeofence(LocationRequest request, Geofence geofence, PendingIntent intent, String packageName)
public void removeGeofence(Geofence geofence, PendingIntent intent, String packageName)
public boolean registerGnssStatusCallback(IGnssStatusListener callback, String packageName)
public void unregisterGnssStatusCallback(IGnssStatusListener callback)
public boolean addGnssMeasurementsListener(IGnssMeasurementsListener listener, String packageName)
public void removeGnssMeasurementsListener(IGnssMeasurementsListener listener)
public boolean addGnssNavigationMessageListener(IGnssNavigationMessageListener listener, String packageName)
public void removeGnssNavigationMessageListener(IGnssNavigationMessageListener listener)
public boolean sendNiResponse(int notifId, int userResponse)
public ProviderProperties getProviderProperties(String provider)
SecurityException
- if the provider is not allowed to be
accessed by the callerpublic String getNetworkProviderPackage()
SecurityException
- if the provider is not allowed to be
accessed by the callerpublic boolean isProviderEnabled(String provider)
public void reportLocation(Location location, boolean passive)
public boolean geocoderIsPresent()
public String getFromLocation(double latitude, double longitude, int maxResults, GeocoderParams params, List<Address> addrs)
public String getFromLocationName(String locationName, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude, int maxResults, GeocoderParams params, List<Address> addrs)
public void addTestProvider(String name, ProviderProperties properties, String opPackageName)
public void setTestProviderLocation(String provider, Location loc, String opPackageName)
public void clearTestProviderLocation(String provider, String opPackageName)
public void setTestProviderEnabled(String provider, boolean enabled, String opPackageName)
public void clearTestProviderEnabled(String provider, String opPackageName)
public void setTestProviderStatus(String provider, int status, Bundle extras, long updateTime, String opPackageName)
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args)