diff options
| author | 2020-12-04 21:26:41 +0000 | |
|---|---|---|
| committer | 2020-12-04 21:26:41 +0000 | |
| commit | e1af0f920fb3de9869eb744fac0d17ac5de030d2 (patch) | |
| tree | df168495f50a924c46cb016d6407ee867a6f63b6 /location/java | |
| parent | 27c33df0c921649917b897e60aefb3fd6ebaf95d (diff) | |
| parent | 7d6333e8245d5432dcb017d601efa4af8888374e (diff) | |
Merge "Clarifying documentation on removeUpdates and flushing"
Diffstat (limited to 'location/java')
| -rw-r--r-- | location/java/android/location/LocationManager.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index 047b809bc766..604c4a1de8f9 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -1509,8 +1509,15 @@ public class LocationManager { } /** - * Removes location updates for the specified {@link LocationListener}. Following this call, - * the listener will not receive any more invocations of any kind. + * Removes all location updates for the specified {@link LocationListener}. The given listener + * is guaranteed not to receive any invocations that <b>happens-after</b> this method is + * invoked. + * + * <p>If the given listener has any batched requests, this method will not flush any incomplete + * location batches before stopping location updates. If you wish to flush any pending locations + * before stopping, you must first call {@link #requestFlush(String, LocationListener, int)} and + * then call this method once the flush is complete. If this method is invoked before the flush + * is complete, you may not receive the flushed locations. * * @param listener listener that no longer needs location updates * @@ -1537,6 +1544,8 @@ public class LocationManager { * Removes location updates for the specified {@link PendingIntent}. Following this call, the * PendingIntent will no longer receive location updates. * + * <p>See {@link #removeUpdates(LocationListener)} for more detail on how this method works. + * * @param pendingIntent pending intent that no longer needs location updates * * @throws IllegalArgumentException if pendingIntent is null |