public class LostClientManager extends java.lang.Object implements ClientManager
LostApiClientImpl to manage connected clients and by
FusedLocationProviderApiImpl to manage client's LocationListeners,
PendingIntents, and LocationCallbacks.| Modifier and Type | Method and Description |
|---|---|
void |
addClient(LostApiClient client) |
void |
addListener(LostApiClient client,
LocationRequest request,
LocationListener listener) |
void |
addLocationCallback(LostApiClient client,
LocationRequest request,
LocationCallback callback,
android.os.Looper looper) |
void |
addPendingIntent(LostApiClient client,
LocationRequest request,
android.app.PendingIntent callbackIntent) |
boolean |
containsClient(LostApiClient client) |
java.util.Map<LostApiClient,java.util.Set<LocationCallback>> |
getLocationCallbacks() |
java.util.Map<LostApiClient,java.util.Set<LocationListener>> |
getLocationListeners() |
java.util.Map<LostApiClient,java.util.Set<android.app.PendingIntent>> |
getPendingIntents() |
boolean |
hasNoListeners() |
void |
notifyLocationAvailability(LocationAvailability availability) |
int |
numberOfClients() |
void |
removeClient(LostApiClient client) |
boolean |
removeListener(LostApiClient client,
LocationListener listener) |
boolean |
removeLocationCallback(LostApiClient client,
LocationCallback callback) |
boolean |
removePendingIntent(LostApiClient client,
android.app.PendingIntent callbackIntent) |
void |
reportLocationChanged(android.location.Location location)
Reports location changed for all listeners respecting their corresponding
LocationRequest.getFastestInterval() and
LocationRequest.getSmallestDisplacement() values. |
void |
reportLocationResult(android.location.Location location,
LocationResult result) |
void |
sendPendingIntent(android.content.Context context,
android.location.Location location,
LocationAvailability availability,
LocationResult result)
Fires intent for all pending intents respecting their corresponding
LocationRequest.getFastestInterval() and
LocationRequest.getSmallestDisplacement() values. |
static LostClientManager |
shared() |
public static LostClientManager shared()
public void addClient(LostApiClient client)
addClient in interface ClientManagerpublic void removeClient(LostApiClient client)
removeClient in interface ClientManagerpublic boolean containsClient(LostApiClient client)
containsClient in interface ClientManagerpublic int numberOfClients()
numberOfClients in interface ClientManagerpublic void addListener(LostApiClient client, LocationRequest request, LocationListener listener)
addListener in interface ClientManagerpublic void addPendingIntent(LostApiClient client, LocationRequest request, android.app.PendingIntent callbackIntent)
addPendingIntent in interface ClientManagerpublic void addLocationCallback(LostApiClient client, LocationRequest request, LocationCallback callback, android.os.Looper looper)
addLocationCallback in interface ClientManagerpublic boolean removeListener(LostApiClient client, LocationListener listener)
removeListener in interface ClientManagerpublic boolean removePendingIntent(LostApiClient client, android.app.PendingIntent callbackIntent)
removePendingIntent in interface ClientManagerpublic boolean removeLocationCallback(LostApiClient client, LocationCallback callback)
removeLocationCallback in interface ClientManagerpublic void reportLocationChanged(android.location.Location location)
LocationRequest.getFastestInterval() and
LocationRequest.getSmallestDisplacement() values. Returns a map of the updated
last reported times so that LostClientManager#requestToLastReportedTime after
all reporting (including pending intents and location callbacks) has been done.reportLocationChanged in interface ClientManagerlocation - public void sendPendingIntent(android.content.Context context,
android.location.Location location,
LocationAvailability availability,
LocationResult result)
LocationRequest.getFastestInterval() and
LocationRequest.getSmallestDisplacement() values. Returns a map of the updated
last reported times so that LostClientManager#requestToLastReportedTime after
all reporting (including pending intents and location callbacks) has been done.sendPendingIntent in interface ClientManagerlocation - public void reportLocationResult(android.location.Location location,
LocationResult result)
reportLocationResult in interface ClientManagerpublic void notifyLocationAvailability(LocationAvailability availability)
notifyLocationAvailability in interface ClientManagerpublic boolean hasNoListeners()
hasNoListeners in interface ClientManagerpublic java.util.Map<LostApiClient,java.util.Set<LocationListener>> getLocationListeners()
getLocationListeners in interface ClientManagerpublic java.util.Map<LostApiClient,java.util.Set<android.app.PendingIntent>> getPendingIntents()
getPendingIntents in interface ClientManagerpublic java.util.Map<LostApiClient,java.util.Set<LocationCallback>> getLocationCallbacks()
getLocationCallbacks in interface ClientManager