Commit Graph

728 Commits

Author SHA1 Message Date
TreeHugger Robot
fffa4e4d86 Merge "Update javadoc of getCodeType to add BDS B1C" into rvc-dev am: 6569339663 am: 957bbd35e4 am: 0bad77936a am: e5150b170e
Change-Id: I6ca43024225056efe9fa9964aa970d2f14ce1306
2020-04-17 23:39:05 +00:00
Yu-Han Yang
8c7011ad8f Update javadoc of getCodeType to add BDS B1C
Bug: 154267746

Test: javadoc only
Change-Id: I2a4391645c8c1315cfb9526ea796562422b3c03c
2020-04-17 02:48:38 +00:00
Soonil Nagarkar
8ecc688a38 Add utilities for creating AppOps listenerIds
Use utilities to support location listenerIds.

Bug: 153687899
Test: presubmits
Change-Id: I269661556e48218fc76e5abc2099bed4c2d667cc
2020-04-15 17:13:02 -07:00
Soonil Nagarkar
4523f96ff1 DO NOT MERGE Add utilities for creating AppOps listenerIds
Use utilities to support location listenerIds.

Bug: 153687899
Test: presubmits
Change-Id: Ie138c98a5f864490c6560166b652ea9509fa8728
2020-04-14 19:04:41 -07:00
Soonil Nagarkar
490c46ca8c Refactor and reorganize listener multiplexers
-Rename manager -> multiplexer where appropriate
-Split into client/server files/packages to minimize amount of code
going into client and keep complexity server side.
-Make GNSS listeners respect location blacklist.
-Add tests.

Test: presubmits + manual
Change-Id: I368e1c6aab1b9bcc1ff771a050431abc8e9c4c00
2020-04-13 11:13:49 -07:00
Soonil Nagarkar
b03841f2b3 Merge "Rename ILocationProviderManager method" 2020-04-09 16:30:02 +00:00
Neil Fuller
714fa9a76b Merge "Minimal skeleton for location time zone providers" 2020-04-09 11:00:41 +00:00
TreeHugger Robot
e1d4509084 Merge "Fix initialization bug in LocationRequest" into rvc-dev am: a23f461e1b am: 22d8e598c4 am: e6b437581a am: 8481c777c3
Change-Id: Ibc92e4c2bf325c908e37d7a7aa1e74c60b328473
2020-04-09 01:00:16 +00:00
Soonil Nagarkar
d879ec9443 Rename ILocationProviderManager method
Test: presubmit
Change-Id: Ib2b0fd5c2065e85b390815fad6a2d7e04b81afb7
2020-04-08 15:51:37 -07:00
Soonil Nagarkar
9d11b38184 Fix initialization bug in LocationRequest
Bug: 153516795
Test: atest BatterySavingLocationTest && manual
Change-Id: I32f7813b16ed747f1da8066714803e7f85ffb5b4
2020-04-08 14:01:17 -07:00
Neil Fuller
0970a9bbb6 Minimal skeleton for location time zone providers
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
2020-04-08 12:11:58 +01:00
Soonil Nagarkar
45e623c63a DO NOT MERGE Add listener ids for location listening operations
Bug: 153257294
Test: presubmits
Change-Id: I12654a3afac5362383caba3cea1c5e0a2b8ce1d9
2020-04-07 17:48:48 -07:00
Soonil Nagarkar
a758407867 Add listener ids for location listening operations
Bug: 153257294
Test: presubmits
Change-Id: I077c6cbb25c79701c36052891a4b0959f7124dbe
2020-04-07 13:56:10 -07:00
Soonil Nagarkar
7fe47adb41 Merge "Fix up LocationRequest and ProviderRequest" into rvc-dev am: 240eaaaaab am: 293347f282 am: 14f734fbed am: d8f077de28
Change-Id: I49e0d5ec63fca56395fee5463633c21cff73f06d
2020-04-02 20:25:51 +00:00
Soonil Nagarkar
c4f8716720 Fix up LocationRequest and ProviderRequest
-Use more idiomatic and efficient parceling
-Cleanup LocationRequest a bit

Bug: 151026407
Test: presubmits
Change-Id: I3865421a128417a5096e39ee110139a13ab9ab3b
2020-04-01 11:06:12 -07:00
Soonil Nagarkar
39766392a7 DO NOT MERGE Refactor appops across location
-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 6033344baa)
Change-Id: I18e2cf3c39836f31d28180e1a4613df4ad675ab7
2020-03-28 13:59:26 -07:00
Soonil Nagarkar
99a2a72529 Make GnssStatus a Parcelable
This saves 24 bytes per serialization and makes code simpler. Also
includes some cleanup in GnssMetrics.

Bug: 152442920
Test: presubmits
Change-Id: I1eb1dfb68190c68e896e87c5bea1f2ec44065e80
2020-03-26 14:36:08 -07:00
Soonil Nagarkar
8aea09fecd DO NOT MERGE Don't lock listener delivery
Previous versions of GNSS listeners commited to not holding locks even
when running directly unfortunately. We do some extra work to avoid
holding locks while running listeners.

Bug: 151291181
Test: manual
Change-Id: I0b7f46c30df2f97ce11db45b69443a9994885309
2020-03-18 19:17:52 -07:00
Yu-Han Yang
9822fa4ff5 Merge "Update inter-signal bias (framework)" into rvc-dev am: f7fcee236e am: 644308c8bc am: 1a4be9a822 am: df40da0489
Change-Id: I8f5188fe3c9be87261233624563776a8d33ae8ea
2020-03-18 19:04:46 +00:00
Yu-Han Yang
b4f806f07f Update inter-signal bias (framework)
- Rename recieverInterSignalBiasNs into interSignalBiasNs, which refers
to the sum of receiver ISB and satellite ISB.

Bug: 150724332

Test: atest GnssMeasurementTest
Change-Id: I322cbe42d24d1f0fe60351c47579323a8715d4d7
2020-03-17 20:42:53 +00:00
Soonil Nagarkar
f29d776667 Rename featureId to attributionTag
Test: presubmits
Change-Id: I6643a2a32057d3a4e0b96b5fa785b68ec2b302b0
2020-03-16 09:55:06 -07:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-12 19:26:10 +00:00
Philip P. Moltmann
8a06c2870e Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-11 23:52:32 +00:00
Soonil Nagarkar
6cc3fce90a Remove remaining LOCATION_PROVIDERS_ALLOWED usages
Bug: 148963686
Test: presubmits
Change-Id: I8dbc8d4f20a63398348547dc3a6467367b9fc8d8
2020-03-11 12:11:37 -07:00
Soonil Nagarkar
03185c5a3c Merge "Add equals() to ProviderProperties" 2020-03-11 17:52:57 +00:00
Soonil Nagarkar
cfb945c470 Add equals() to ProviderProperties
This lets us ignore updates to properties which are the same, and spend
less cycles giving everyone state updates when nothing has changed. Also
updates the Parcelable format for ProviderProperties, and removes dead
code from ServiceWatcher.

Test: presubmits
Change-Id: Ia6517438ff8988064247cc8d3288d576f73a1aa9
2020-03-11 08:52:00 -07:00
Automerger Merge Worker
5eb75138e1 Merge "Restore legacy SecurityException behavior" into rvc-dev am: 0ea91490c5 am: 9942a42bd6 am: 963cc1a02f am: d1b373fef8 am: b62baf2ea9
Change-Id: I95450ce350d170bf1997e6a3880cea4e0186e822
2020-03-09 22:00:44 +00:00
Soonil Nagarkar
bf016bb7ea Restore legacy SecurityException behavior
For apps that do not target R+, throw SecurityExceptions within
getProvider().

Bug: 150935354
Test: na
Change-Id: I37e9fc1cbcc1cb6ed941c3905ff253d798fc0ac8
2020-03-09 03:15:51 +00:00
Automerger Merge Worker
1276b66a26 Merge "Address Puller API Feedback" into rvc-dev am: 8651b62518 am: eff89f9fcf am: c7a97df065 am: 6776affc26
Change-Id: Ib42990a37d5b00945f4e662554853d47ff1ee86e
2020-03-07 22:46:31 +00:00
Tej Singh
72a70a8a3c Address Puller API Feedback
1. Rename registerPullAtomCallback to setPullAtomCallback
2. Rename unregisterPullAtomCallback to clearPullAtomCallback
3. Add getters to PullAtomMetadata
4. Change Ns to Millis (when I tried to make it Nanos, I received a
built time error saying to prefer millis unless we need the precision.
We do not need the precision, so I changed it).
5. Fix out of order params.

I did not change usePooledBuffer to setPooledBuffer because I think use
is more appropriate for our use case.

Test: make
Test: atest PullAtomMetadataTest
Test: atest GtsStatsdHostTestCases
Bug: 149475498

Change-Id: Ib07aa57a6e02c77917fe0e65a3d4a77c00ce8565
2020-03-05 16:43:02 -08:00
Soonil Nagarkar
1eb8014bd2 Merge "Give location providers a known identity" 2020-03-04 23:05:49 +00:00
Soonil Nagarkar
470c8f6a3f Give location providers a known identity
Providers no longer need the ability to specify additional packages,
this can be replaced with tracking the provider identity.

In addition, move CallerIdentity into the client space, and fix some
minor GNSS bugs.

Bug: 149839935
Test: atest LocationProviderTest
Change-Id: Ide107abc61531946b20d2ac50cd9555fc215ef03
2020-03-04 12:38:31 -08:00
Soonil Nagarkar
c178f80d47 Make calls for geocoder one way
All calls out of system server must be oneway to prevent the system from
being blocked by external code. Geocode has been the very last interface
not to conform to this - this is now fixed.

Bug: 146677166
Test: atest GeocoderTest
Change-Id: Ib04d36a9b759f1737ebc2806e49f0bf1e53cea7c
2020-03-04 11:04:09 -08:00
Automerger Merge Worker
eb246cf920 Merge "Quick fix for possible deadlock in LMS" into rvc-dev am: 45b8146ae8 am: 98c1646443 am: 4ec5b2f0ff am: 5d2e7f95e9
Change-Id: I418c5c6b5321913989f090afb03be541c73324a4
2020-03-03 03:45:44 +00:00
TreeHugger Robot
853823717d Merge "Log permission mismatch with 128s emergency extension" 2020-03-03 03:07:16 +00:00
Soonil Nagarkar
5df43c11e5 Quick fix for possible deadlock in LMS
LMS dispatches in-process location events while holding locks, which
can lead to deadlock if combined with another lock. This went from a
possibility to a definitive deadlock with the introduction of the
getCurrentLocation cancel() API. This fix prevents that deadlock by
not holding a lock while canceling. It is still technically possible
for other components to introduce deadlock by using their own locks
within the system process, but as there are very few location clients
inside the system server, and none of them appear to be at risk right
now, a complete fix is delayed until S.

Bug: 149780283
Test: presubmits
Change-Id: I9d202adc65380881969d276c470ef1bf52828e82
2020-03-02 16:42:20 -08:00
Yu-Han Yang
c0fe2bac01 Add comments to messageId, subMessageId and data
Bug: 147768625

Test: doc only and builds
Change-Id: I4a75d0cb015c47caaeaf93acffbca34d9eaea523
2020-02-28 11:39:47 -08:00
Soonil Nagarkar
5e793ba9d7 Merge "Updates and fixes to GnssMeasurementsProvider" 2020-02-28 16:57:17 +00:00
TreeHugger Robot
003af80cc5 Merge "Add comments to messageId, subMessageId and data" 2020-02-28 04:09:18 +00:00
Yu-Han Yang
5ca36f4012 Log permission mismatch with 128s emergency extension
Bug: 145793324
Test: on device
Change-Id: Iea685e407aebe1fb77bb57c9df9f8034f9641d58
2020-02-27 14:31:42 -08:00
Soonil Nagarkar
afe1adfb1d Updates and fixes to GnssMeasurementsProvider
Listen for changes to developer full tracking setting, and respect that
from within GnssMeasurementsProvider, and fix some nullable
inconsistencies.

Test: manual + presubmits
Change-Id: Id000d97d528ed579f064c2f89ed2025ef97aa7b5
2020-02-27 13:23:30 -08:00
Soonil Nagarkar
6257ba865c Refactor GNSS listeners
Gnss listeners currently simply ignore requests that are not made in the
foreground or with appropriate permissions, even though these are
transitory attributes. In addition, some gnss listener use appops APIs
incorrectly. The RemoteListenerHelper pattern is not great either, and
makes it extremely difficult to write clear code, as well as duplicates
much of the functionality provided by AbstractListenerManager on the
client side. This CL unifies logic for multiplexing listeners so it can
be used across both the client and server side, and updates all GNSS
listeners to use the new model, which properly respects foreground,
appops, permissions, gnss enablement, and capabilities.

Test: presubmits + manual
Change-Id: I8f158e860e10c3ed43b246f6f3687169ac134343
2020-02-26 23:48:16 -08:00
Sasha Kuznetsov
9ccc663459 Address API council comments
Bug: 150204947
Bug: 150205126
Bug: 150205105
Test: atest GnssAntennaInfoRegistrationTest && atest GnssAntennaInfoTest && atest GnssAntennaInfoProviderTest && atest GnssManagerServiceTest && atest VtsHalGnssV2_1TargetTest && atest LocationManagerFineTest
Change-Id: I3a58fa7742b4885e743fed0555e5499a75bccac5
2020-02-26 05:53:29 +00:00
Soonil Nagarkar
e9af9a8b92 Merge "Refactor appops across location" 2020-02-24 22:52:51 +00:00
Blake Kragten
e4383d8999 Merge "GnssMetrics" 2020-02-21 22:15:29 +00:00
Soonil Nagarkar
6033344baa Refactor appops across location
-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.

Test: presubmits + manual
Change-Id: I0ab6318093b1a7c7210ce9e39ccccf75d4f2eb66
2020-02-21 10:09:02 -08:00
Tim Murray
a2668e55dc Merge "LocationManager: cache isLocationEnabledForUser" 2020-02-21 05:04:14 +00:00
Tim Murray
b5e1153d03 LocationManager: cache isLocationEnabledForUser
This method is in the hot path for all location tasks but whether
location is enabled for a particular user doesn't change that
often. Cache the result and invalidate from system_server in order to
reduce CPU consumption.

Test: boots, works, gets location
Bug: 140788621

Change-Id: I84ad2c570e7024187a728071dcbb6f72b177e17a
2020-02-20 17:11:04 -08:00
Blake Kragten
6ce382a372 GnssMetrics
These metrics will pull different metrics that tell the performance of the gnss subsystem.

Metrics include:
Location reports
% of location failure
Num times GPS had to first fix
Mean time to first fix on signal
Num position accuracy logs
Mean position accuracy in meters
Num top 4 Cn0 messages
Mean top 4 average Cn0 (signal quality)
Num L5 top 4 Cn0 messages
Mean L5 top 4 average Cn0 (signal quality)
Num Satellite status messages received
Num of Satellites used in fix
L5 Satellite status messages received
L5 of Satellites used in fix

metric_id: 1111
gauge_metrics {
  data {
    bucket_info {
      atom {
        gnss_stats {
          location_reports: 12
          location_failure_reports: 3
          time_to_first_fix_reports: 2
          time_to_first_fix_milli_s: 43588
          position_accuracy_reports: 9
          position_accuracy_meters: 112
          top_four_average_cn0_reports: 31
          top_four_average_cn0_db_mhz: 734711
          l5_top_four_average_cn0_reports: 1
          l5_top_four_average_cn0_db_mhz: 21500
          sv_status_reports: 1015
          sv_status_reports_used_in_fix: 100
          l5_sv_status_reports: 7
          l5_sv_status_reports_used_in_fix: 0
        }
      }
      elapsed_timestamp_nanos: 537249375445
      start_bucket_elapsed_millis: 522186
      end_bucket_elapsed_millis: 549283
    }
  }
}
time_base_elapsed_nano_seconds: 9283624934
bucket_size_nano_seconds: 60000000000
is_active: true

Bug: 147910698
Test: On Device using test script and gnsslogger.apk
>  make statsd_testdrive
>  ./out/host/linux-x86/bin/statsd_testdrive <ATOM_ID>

Change-Id: I92461eb8533ec810bb67d76a25931295cfa1efbd
2020-02-19 17:07:11 -08:00
Soonil Nagarkar
3819f972df Revert requestSetProviderEnabled API
Bug: 144955780
Test: presubmits
Change-Id: Iec8520acfd98b9d9d92a4876ebfa899ac2a0731e
2020-02-19 14:39:58 -08:00