LocationRequestStatisticspublic class LocationRequestStatistics extends Object Holds statistics for location requests (active requests by provider).
Must be externally synchronized. |
Fields Summary |
---|
private static final String | TAG | public final HashMap | statistics |
Methods Summary |
---|
public void | startRequesting(java.lang.String packageName, java.lang.String providerName, long intervalMs)Signals that a package has started requesting locations.
PackageProviderKey key = new PackageProviderKey(packageName, providerName);
PackageStatistics stats = statistics.get(key);
if (stats == null) {
stats = new PackageStatistics();
statistics.put(key, stats);
}
stats.startRequesting(intervalMs);
| public void | stopRequesting(java.lang.String packageName, java.lang.String providerName)Signals that a package has stopped requesting locations.
PackageProviderKey key = new PackageProviderKey(packageName, providerName);
PackageStatistics stats = statistics.get(key);
if (stats != null) {
stats.stopRequesting();
} else {
// This shouldn't be a possible code path.
Log.e(TAG, "Couldn't find package statistics when removing location request.");
}
|
|