Following are the review comments from API Council:
(Places below that reference "s/foo/bar/" below are suggesting that "foo" be
replaced with "bar".)
GnssClock
-- Class docs should not refer to "GPS" at the top level
-- s/InNs/Nanos/
-- s/Sec/Second/
GnssMeasurement
-- s/In// for "InUnitname"
-- s/Sec/Second/
-- s/Ms/Millis/
-- s/Deg/Degrees/
-- STATUS_GPS_LOCATION_DISABLED -> STATUS_GNSS_LOCATION_DISABLED
GnssMeasurementsEvent.Callback
-- "returns" -> "reports" in the method docs as the methods return void
LocationManager
-- register/unregisterGnssMeasurementEventCallback ->
register/unregisterGnssMeasurementsEventCallback (plural)
GnssNavigationMessage
-- MESSAGE_TYPE_ constants -> change to just TYPE_; the "MESSAGE" is redundant
with the class name
-- is a signed byte/short ok based on the standard here? If not consider using
int in the public api
GnssStatus
-- Make sure @IntDef exists for the constellation type
-- Please append unit types for values returned to match GnssMeasurement methods
GnssStatusCallback
-- Please document time base/units for the time parameter of onFirstFix
Bug: 27385557
Change-Id: Ifed6a2eca3fd7ba89b3ded6964a70376235af8f4
Similar to first patch, but now using new "rethrowFromSystemServer()"
method which internally translates DeadObjectException into
DeadSystemException. New logic over in Log.printlns() now
suppresses the DeadSystemException stack traces, since they're
misleading and just added pressure to the precious log buffer space.
Add some extra RuntimeInit checks to suppress logging-about-logging
when the system server is dead.
Bug: 27364859
Change-Id: I05316b3e8e42416b30a56a76c09cd3113a018123
Those APIs are already used by first-party Apps for a while. We now make them
available to third-party Apps as well.
Change-Id: I87d9f0dbb04831fc849228d7df03a2686e2eb383
-Use bitmask for has*** methods.
-Use ThreadLocal for caching intermediate computations
rather than preallocating memory in every Location
Change-Id: If2fa17bfd59511ec0b809f4b7d7cd8028360c340
Minute values in the range [0, 59] are valid if seconds are
present. If seconds are not present then minute values are
valid in the range [0, <60]
Second values are valid in the range [0, <60]
Examples:
50:59:59.99999 is valid
50:59.99999 is valid
50:59.1:1 is not valid
Patch taken from Motorola: partner gerrit 137210
Bug: 17958582
Change-Id: I0d1265534092157883af564119f723984362d436
Issues: 2667 and 2668
-Register for listener for permission changes and stop
request immediately if client loses permission.
-Also remove permission requirement to remove geofences
and clean up permission annotations.
Bug: 21903866
Change-Id: I7e028b6b2ca5b21f25fcbba5de86dfb55caff872
Country information is already available elsewhere (MNC/MCC), so there's no
point enforcing these permissions.
It wasn't properly enforcing the permissions anyway, since the code path in
question was sometimes executed on a handler thread.
Bug 20927020
Change-Id: Ia090664917f7b694e80dd55934db442633bab1d8
The access mock location is no longer a runtime permission. It is a
signature protected one that apps cannot get but the fact they request
it means they want to inject location into the system. Now the user
gets to choose the current mock location app in developer options from
the apps that request the mock location permission. The access to mock
location is no longer guarded by the permisson but from a new app op
which is off by default and the settiings UI sets it to enabled only
for the currently selected mock location app.
bug:21078873
Change-Id: I19e3f9dc7c7de82eab46b30fec1abfbca54a0e59
b/19938206
All new introduced APIs are hidden.
GpsMeasurement#isPseudorangeRateCorrected() is need to properly identify different types
of data provided by different partners. Given the nature of each GPS engine, this change is
required to accomodate the data that can be provided by many partners.
GpsNavigationMessage#getStatus() is required to ensure that the Location process is aware
if the state of the messages, and can act depending on it.
Change-Id: Ie34b1e69bf26a1bde86931ce61168421429bf8f8
It fixes cases when flags where filtered in the platform, because they were
checked as enums.
It also simplies handling of future values in enums/flags.
Change-Id: I83a0f82cc4562749081bf7e279ea52e2d5ba1f7c
A simple GpsStatus object uses 9K of space, given that it initializes an array
of 255 GpsSatellite objects.
This change reduces the memory footprint in the average case, and keeps the
semantics of the API and its GpsSatellite sibling objects without any changes.
In a best case scenario it brings the memory usage per object to 1K.
It's likely in most cases that only 20-50 satellites will be in view. So the
usage should not exceeed half of the original memory usage.
It was considered to keep the internal array but a SparseArray provided bigger
memory savings in the test scenario of ~700B.
Change-Id: Ie2d2144d776a74d4904a08c0d6c5aec6d3bba7cc
The Location.convert() methods do not invert each other as might be
expected. Changing this would introduce breaking changes, so I've
updated the javadocs to make this clearer.
Bug: 13280976
Change-Id: If4bd3c83d5fb67915450849ca471aabc27544dac
The race condition only affects when the client registers for several (all) location listeners.
And the side efects are benign: only the measurement and navigation message status are incurrectly
being sent to the application, but there are no crashes or any real data from GPS being
misscommunicated.
Also:
- cache the last reported status to filter sending notifications when no changes have occurred
- do some cleanup and refactoring in the code changed
Change-Id: I0692e6b70847dc1ee092d7a05a2c6ba3cd9fa147
b/16727892
b/16815124
The listeners are changed to receive statuses asynchronously, this is required because GPS HAL,
requires time to be notified of the capabilities it supports.
Change-Id: Ie69fdd629d8680341386a2c736bc851632dd2bda