@Implements(value=android.location.LocationManager.class) public class ShadowLocationManager extends Object
LocationManager.| Constructor and Description |
|---|
ShadowLocationManager() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGpsStatusListener(android.location.GpsStatus.Listener listener) |
List<String> |
getAllProviders() |
String |
getBestProvider(android.location.Criteria criteria,
boolean enabled) |
android.location.Criteria |
getLastBestProviderCriteria()
Non-Android accessor.
|
boolean |
getLastBestProviderEnabledOnly()
Non-Android accessor.
|
android.location.Location |
getLastKnownLocation(String provider) |
List<String> |
getProviders(boolean enabledOnly) |
Collection<String> |
getProvidersForListener(android.location.LocationListener listener) |
Map<android.app.PendingIntent,android.location.Criteria> |
getRequestLocationUdpateCriteriaPendingIntents() |
Map<android.app.PendingIntent,String> |
getRequestLocationUdpateProviderPendingIntents() |
List<android.location.LocationListener> |
getRequestLocationUpdateListeners()
Non-Android accessor.
|
boolean |
hasGpsStatusListener(android.location.GpsStatus.Listener listener) |
boolean |
isProviderEnabled(String provider) |
void |
removeGpsStatusListener(android.location.GpsStatus.Listener listener) |
void |
removeUpdates(android.location.LocationListener listener) |
void |
removeUpdates(android.app.PendingIntent pendingIntent) |
void |
requestLocationUpdates(long minTime,
float minDistance,
android.location.Criteria criteria,
android.app.PendingIntent pendingIntent) |
void |
requestLocationUpdates(String provider,
long minTime,
float minDistance,
android.location.LocationListener listener) |
void |
requestLocationUpdates(String provider,
long minTime,
float minDistance,
android.location.LocationListener listener,
android.os.Looper looper) |
void |
requestLocationUpdates(String provider,
long minTime,
float minDistance,
android.app.PendingIntent pendingIntent) |
boolean |
setBestProvider(String provider,
boolean enabled) |
boolean |
setBestProvider(String provider,
boolean enabled,
List<android.location.Criteria> criteria)
Sets the value to return from
getBestProvider(android.location.Criteria, boolean) for the given
provider |
void |
setLastKnownLocation(String provider,
android.location.Location location)
Sets the value to return from
getLastKnownLocation(String) for the given provider |
void |
setProviderEnabled(String provider,
boolean isEnabled)
Sets the value to return from
isProviderEnabled(String) for the given provider |
void |
setProviderEnabled(String provider,
boolean isEnabled,
List<android.location.Criteria> criteria) |
void |
simulateLocation(android.location.Location location) |
@Implementation public boolean isProviderEnabled(String provider)
public void setProviderEnabled(String provider, boolean isEnabled)
isProviderEnabled(String) for the given providerprovider - name of the provider whose status to setisEnabled - whether that provider should appear enabledpublic void setProviderEnabled(String provider, boolean isEnabled, List<android.location.Criteria> criteria)
@Implementation public android.location.Location getLastKnownLocation(String provider)
@Implementation public boolean addGpsStatusListener(android.location.GpsStatus.Listener listener)
@Implementation public void removeGpsStatusListener(android.location.GpsStatus.Listener listener)
@Implementation public String getBestProvider(android.location.Criteria criteria, boolean enabled)
@Implementation public void requestLocationUpdates(String provider, long minTime, float minDistance, android.location.LocationListener listener)
@Implementation public void requestLocationUpdates(String provider, long minTime, float minDistance, android.location.LocationListener listener, android.os.Looper looper)
@Implementation
public void requestLocationUpdates(long minTime,
float minDistance,
android.location.Criteria criteria,
android.app.PendingIntent pendingIntent)
@Implementation public void requestLocationUpdates(String provider, long minTime, float minDistance, android.app.PendingIntent pendingIntent)
@Implementation public void removeUpdates(android.location.LocationListener listener)
@Implementation public void removeUpdates(android.app.PendingIntent pendingIntent)
public boolean hasGpsStatusListener(android.location.GpsStatus.Listener listener)
public android.location.Criteria getLastBestProviderCriteria()
Gets the criteria value used in the last call to getBestProvider(android.location.Criteria, boolean)
public boolean getLastBestProviderEnabledOnly()
Gets the enabled value used in the last call to getBestProvider(android.location.Criteria, boolean)
public boolean setBestProvider(String provider, boolean enabled, List<android.location.Criteria> criteria) throws Exception
getBestProvider(android.location.Criteria, boolean) for the given
providerprovider - name of the provider who should be considered bestenabled - Enabledcriteria - List of criteriaException - if provider is not knownpublic boolean setBestProvider(String provider, boolean enabled) throws Exception
Exceptionpublic void setLastKnownLocation(String provider, android.location.Location location)
getLastKnownLocation(String) for the given providerprovider - name of the provider whose location to setlocation - the last known location for the providerpublic List<android.location.LocationListener> getRequestLocationUpdateListeners()
public void simulateLocation(android.location.Location location)
public Map<android.app.PendingIntent,android.location.Criteria> getRequestLocationUdpateCriteriaPendingIntents()
public Map<android.app.PendingIntent,String> getRequestLocationUdpateProviderPendingIntents()
public Collection<String> getProvidersForListener(android.location.LocationListener listener)
Copyright © 2016. All rights reserved.