From c78096749ff6adb85692d4edde8958ac25a2f0e5 Mon Sep 17 00:00:00 2001 From: Soonil Nagarkar Date: Fri, 12 Aug 2022 08:33:36 -0700 Subject: Update Location docs for isMock() Add javadocs mentioning isMock() and why it exists to the top level Location docs. Bug: 240004850 Test: n/a Change-Id: I208cb1fb4d213de33822d5109a4e822b470fd74d --- location/java/android/location/Location.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'location/java') diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java index 55ee3aaaaf77..f5a9850b31dd 100644 --- a/location/java/android/location/Location.java +++ b/location/java/android/location/Location.java @@ -47,6 +47,15 @@ import java.util.StringTokenizer; *

All locations generated through {@link LocationManager} are guaranteed to have a valid * latitude, longitude, timestamp (both Unix epoch time and elapsed realtime since boot), and * accuracy. All other parameters are optional. + * + *

Note that Android provides the ability for applications to submit "mock" or faked + * locations through {@link LocationManager}, and that these locations can then be received by + * applications using LocationManager to obtain location information. These locations can be + * identified via the {@link #isMock()} API. Applications that wish to determine if a given location + * represents the best estimate of the real position of the device as opposed to a fake location + * coming from another application or the user should use this API. Keep in mind that the user may + * have a good reason for mocking their location, and thus apps should generally reject mock + * locations only when it is essential to their use case that only real locations are accepted. */ public class Location implements Parcelable { -- cgit v1.2.3-59-g8ed1b