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