Will minimize future changes:
-Never return null GpsStatus to avoid breaking legacy clients
-Allow null location callback complete callbacks
-Return void from sendExtraCommand
-Combine appops and permissions checks into a single helper
-Allow passive provider to remember last locations even when there is
no active passive request.
-Add a couple new injectable helpers to support future changes along
with fakes for testing.
Test: presubmits + manual
Change-Id: If22bee787c5ab5c8c09d20e4742a8b5d1b7f0b59
Currently, Java clients are manually creating the StatsEvent objects
which can lead to errors. Now that there is support for pulled atoms for
stats-log-api-gen for Java clients, use the appropriate buildStatsEvent
method that was auto generated by stats-log-api-gen.
Bug: 160368804
Test: Ran `m` and completed successfully
Test: Ran `atest statsd_test` and all CTS tests passed
Test: Ran `atest UidAtomTests` and all CTS tests passed except for the CTS tests related to a SIM card because the device does not have a SIM card
Change-Id: Id229ba5ca94203135a8a5e2607de9844e0432ce1
The package name from the service watcher may be inconsistent with the
package name of the currently bound service.
Test: none
Change-Id: Iede437d2e61a0da0b853fdbb133a29add04f6bf3
Discrepency between documented and delivered thread in prior versions
got confused. Switching back to the main thread for delivery when not
specified.
Bug: 160565229
Test: presubmit only
Change-Id: I3461f16278a38082f7101b83e9e23b1e30c949b0
Discrepency between documented and delivered thread in prior versions
got confused. Switching back to the main thread for delivery when not
specified.
Bug: 160565229
Test: presubmit only
Change-Id: I6deaf08e2045771c120aa2eb35c64b392208bd58
Removes the necessity for LMS to call back into client code to inform
the client that a location listener has been removed. This is replaced
with weak references instead, which allows the garbage collector to
handle cleanup instead. This simplifies LMS implementation and makes it
less buggy.
Also includes some rewrites of getCurrentLocation to use a dedicated
AIDL interface now that the onRemoved channel is no longer available,
as well as various other minor refactors.
Test: manual + presubmits
Change-Id: Ic61ce278c44e23bc5da5b703f89f6e656e89dea2
Pass direct executor to setPullAtomCallback. This causes the puller to
run directly on the binder thread, as opposed to the Background thread,
which could be busy with other work.
This change means that the puller can be executed concurrently. To
properly handle that, the Statistics class is made thread-safe.
Test: adb shell cmd stats pull-source 10074
Bug: 157186182
Change-Id: I6c0940fd4ed231f9d962981cc1f9e8c983c48f7f
CP to rvc-dev to avoid automerger conflicts for ag/11727208.
Test: m
Bug: 157186182
Change-Id: I1b2dc636b90e6a643a2d5722022671563955f96a
Merged-In: I1eb1dfb68190c68e896e87c5bea1f2ec44065e80
Location permission info is 1) location specific and 2) may change over
time, and thus shouldn't be in CallerIdentity. This CL moves the
information (temporarily) into LocationRequest. Follow up CLs will
include deeper refactors that eliminate the need for this information to
be in LocationRequest as well.
Test: manual + presubmits
Change-Id: I3b4b41941e386f644efce2effe6985b9c865586c
This makes all LM listeners static, saving memory across LM instances in
an application. In addition, listeners for rarely used APIs such as GNSS
APIs are now initialized on-demand to save memory. Finally, the new
transport framework is adopted for location listeners, which means a new
transport object will be used for every location request, eliminating
several edge case bugs around listener removal.
Test: manual + cts
Change-Id: I1f374248baf695323177f347873fed72841f85d0
-Makes geofence manager work synchronously so that testing is not flaky
-Adopts ListenerMultiplexer for geofence listeners so that logic is
shared across location code
-Adds support for location blacklisting and background users
-Substantially reduces the CPU overhead of maintaining listeners
-Adds worksource support to geofencing so power blame is done correctly
-Adds new feature id for geofencing
Test: manual + presubmit
Change-Id: If55bc18f202debf7dd183f0120a24e8f75623ce8
Remove LocationTimeZoneProviderRequest.workSource and correct some docs.
Bug: 152744911
Test: treehugger only
Change-Id: Ibd26886a1c4e66507bbcaafc5132b615e5af443e
Minimal skeleton for location time zone providers. Most behavior has
been stripped and more detail will be added later.
Test: atest services/tests/servicestests/src/android/location/timezone/LocationTimeZoneEventTest.java
Test: services/tests/servicestests/src/com/android/internal/location/timezone/LocationTimeZoneProviderRequestTest.java
Change-Id: I64102df0970e6cfbcc07c9377b226c8663a29a74
-Use more idiomatic and efficient parceling
-Cleanup LocationRequest a bit
Bug: 151026407
Test: presubmits
Change-Id: I3865421a128417a5096e39ee110139a13ab9ab3b
-Add a new app ops helper to make testing easier.
-Consolidate app identity within CallerIdentity class.
-Remove location age restriction for coarse locations, was a bit
arbitrary.
-Remove listener identifiers from LM. These were not being properly
propagated and add a lot of binder overhead with what appears to be
little benefit since we have featureIds, which contain much better
information.
-Remove appops checks from some GNSS APIs that shouldn't require it.
-Move location fudger into location providers and reset them after mock
providers are used so that offset information cannot be leaked.
Bug: 149375028
Test: presubmits + manual
(cherry picked from commit 6033344baaa8aa10b89a779864b7f5f82f4baf32)
Change-Id: I18e2cf3c39836f31d28180e1a4613df4ad675ab7
This saves 24 bytes per serialization and makes code simpler. Also
includes some cleanup in GnssMetrics.
Bug: 152442920
Test: presubmits
Change-Id: I1eb1dfb68190c68e896e87c5bea1f2ec44065e80