Three bugs were present here:
1) isLocationEnabled() will return incorrect results for USER_CURRENT
and USER_CURRENT_OR_SELF
2) Disabling the location enabled cache does not work properly in the
system process, we only disable the cache for a single instance of
LocationManager.
3) isLocationEnabled() was not respecting the user as defined by the
context used to create the LocationManager.
Bug: 185401689
Test: atest CtsLocationFineTestCases
Change-Id: I84bff02604a4b2d84494a0e099e172c4ffb400a2
Updates various docs around location time, and also fixes up some
deprecated method usage.
Bug: 184726840
Test: presubmits
Change-Id: I79365e2a3608c8eaeba954b7c193775e98fb2a91
Also renames *FromMockProvider to *Mock for clarity.
Bug: 183632564
Test: atest CtsLocationFineTestCases
Change-Id: Ic3b2cc2ec69d6a632e347868e7cc53e56e7400b0
Split it up into more generic and useable components that are not as
location specific.
Bug: 182491144
Bug: 181665909
Test: presubmits
Change-Id: I2d6d5e70328657a7430e170531402cb3acbed028
Adds additional logging around user switches, and fixes a bug where
location toggle changes were not logged correctly.
Bug: 183409327
Test: manual
Change-Id: I36fdef5c3eddd3db70d7c18506f82bb687677120
Replace broadcast with listeners in response to API feedback.
Bug: 178714745
Test: atest CtsLocationFineTestCases
Change-Id: Ibb52b167c916fa6b5a9238371ba26b86801389d2
Make tag list nonnull, and rename to extraAttributionTags, and add shell
command support for adding location provider with extra attribution
tags.
Bug: 181254689
Test: presubmits
Change-Id: I52e55094c7043d0e75f902a4177f15e27b018de5
CorrelationVector#getFrequencyOffestMetersPerSecond() should return double.
Bug:179389247
Test: on cuttlefish
Change-Id: I0a999915a0dccb06abb65af68105abd862c14708
The platform has the concept of a location provider which could
be a plugin implemented by another package. The implementation
of a location provider plugin can make calls to APIs that require
a location permission, e.g. fusing data from different sources.
However, such accesses are counted in app ops as a location access
but the accessor is in this case the data source. It is also
possible that the package that provides the implementation of a
location provider also hosts other funcionality which may need to
call APIs that require a location permission.
This change allows a location provider to specify app op attribution
tags which which could be used when calling location to singal to the
OS that the access is for the location providing functionality of the
location provider. For location accesses of the provider package that
are not related to providing location to the OS the provider can use
any other non delcared as location attribution tags. Accesses with
the location attribution tags would be counted in app ops but instead
of towards the OP_COARSE_LOCATION/OP_FINE_LOCATION the would be
counted towards dedicated OP_COARSE_LOCATION_PROVIDER/
OP_FINE_LOCATION_PROVIDER ops. This would allow proper classification
while enabling auditability and tracking via the standard app op APIs.
<meta-data
android:name="android:location_allow_listed_tags"
android:value="foo;bar;baz"/>
Test: atest android.location.cts.fine.LocationManagerFineTest#testLocationAttributionTagBlaming
Bug:179062648
Change-Id: I36739ab42cedc94e1aa7a3bfd3b9aa213f5b3e97
This will allow us to better distinguish between clients in our
historical data.
Bug: 180857151
Test: presubmits
Change-Id: Idd0123ca15f54f8380107c9cc0b6f24474532b3d
Throttle location providers completely when the device is completely
still, and provide "faked" locations instead.
Bug: 172688700
Test: manual + atest StationaryThrottlingLocationProviderTest
Change-Id: Iba4e50ebf78cd8c6a9f2433ecb6e967d3a533c63
Since Android S, carrier frequencies in GnssStatus and GnssMeasurement are
required. Also added a comment to clarify AGC value.
Bug: 179157665
Bug: 173523109
Test: comment only
Change-Id: I1f59bcc0c26739a2057037da766cd0a5206e06ff
Reduce number of generated synthetic accessors for private var/methods,
put ProviderRequest listener into lazily loaded class, and switch to
ArrayMap instead of WeakHashMap when server-side transport removal is
not a consideration. Also adds support for replacing an old transport
in a single remote call, rather than two remote calls.
Bug: 13463193
Test: none
Change-Id: I09dab317dc82aeda51422af1047274631081c3e1
After API council feedback, use List<Location> in public APIs rather
than LocationResult.
Bug: 173712888
Test: atest CtsLocationFineTestCases
Change-Id: I02caa1f9c7164b52ef55c71ca14fb2bd7e311a85
Move GNSS listener overhead into statics so it's shared per process, and
do not instantiate by default.
Previously GNSS requests were multiplexed by LocationManager instance,
this is now removed. This could mean additional binder overhead, but
it's pretty unlikely that this feature was in active use anywhere, as in
any large application that has multiple gnss requests, they are usually
coming from different contexts (and thus LocationManager instances) and
would not have seen the benefit of multiplexing anyways.
Bug: 179261871
Test: atest CtsLocationFineTestCases
Change-Id: I8b7a41c13dfe219c326b1e519483d89d2b721ce5