summaryrefslogtreecommitdiff
path: root/location/java/com
AgeCommit message (Collapse)Author
2025-02-26Clean up KeepForWeakReference usage Jared Duke
We now rely on the WeaklyReferencedCallback annotation to automatically preserve fields that are needed to keep callback type instances that are weakly referenced when registered. The affected members should be identically preserved with this change. Bug: 349245577 Test: FULL_SYSTEM_OPTIMIZE_JAVA=true m services Flag: EXEMPT refactor Change-Id: Idb54509fde818d52eff2edeaa694c2c1393e1149
2025-02-24Cleaned up the flag enforce_telephony_feature_mapping_for_public_apis Jack Yu
Cleaned up the 24Q3 flag enforce_telephony_feature_mapping_for_public_apis Test: Basic telephony functionality tests Test: atest FrameworksTelephonyTests Bug: 297989574 Flag: EXEMPT flag cleanup Change-Id: If41ad237f55baa9df032564a5316d216e9d5838b
2024-11-24Add helper functions to S2CellIdUtils. Ludovic Barman
These methods are required for the density-based coarse location feature. They match the implementation of the S2 lib in google3. As per the code owners request, since this lib will now be used both by the altitude module and our coarse locations, it is moved outside of the altitude/ folder, into a new s2/ folder. As a result, four methods have to become public. For location coarsening, we add the following methods: - In S2CellIdUtils, add a method toLatLngDegrees(s2cellId, latlng) which sets latlng to the center of the cell - In S2CellIdUtils, add a method containsLatLng(s2cellId, latlng) -> Boolean Tests: - atest FrameworksMockingServicesTests:S2CellIdUtilsTest NB: as discussed with the code owners, these are non-API changes that shouldn't be flagged. If need be, it could be gated behind the feature flag for the larger change (see other CLs) Test: manual atest on Pixel 7 pro (see above) Bug: 376198890 Flag: EXEMPT non-AI changes Change-Id: If1ec4b05b97e1916ce988264e6110102b60e19a9
2024-07-29Keep members needed for downstream weak refs Jared Duke
Annotate several fields that are needed solely to keep alive downstream weak refs. A more general solution is being pursued, but for now this addresses some of the known issues when full optimization is enabled. Test: FULL_SYSTEM_OPTIMIZE_JAVA=true m + check member preserved Bug: 349245577 Flag: EXEMPT bugfix Change-Id: I3683fd9909cd7881a907a26b8dcd564d1877df64
2024-07-09Replace hidden_api_packages with package-info.java and @hide Paul Duffin
The `hidden_api_packages` is being removed from Soong so this replaces it with a `package-info.java` containing `@hide` for each hidden package. Hiding the `com.android.nfc` had no effect so no `package-info.java` file was created for that. Bug: 351991463 Test: m checkapi Change-Id: I67043afb34f10d4e9e910bd7e6d671c39414e0f7
2024-02-01Adds geoid map assets used to calculating expiration distances in ↵ Brian Julian
AltitudeConverter. Test: FrameworksMockingServicesTests:AltitudeConverterTest Bug: 304375846 Change-Id: If358669f2bf11df52b797220d276a467ff996efc
2024-01-26Adds to AltitudeConverter a method that returns a geoid height at the ↵ Brian Julian
location (go/msat:geoid-heights-altitude-hal-design). Note that the implementation uses *fake* assets for calculating expiration distances, specifically, a copy of the geoid height assets. Real assets will be added in followup CLs. Test: FrameworksMockingServicesTests:AltitudeConverterTest Bug: 304375846 Change-Id: I78bc3c9f9d814f750c38c627ee9af8dc27183e2a
2023-12-20Data only device(without FEATURE_TELEPHON_CALLING) : Add try/catch to handle ↵ joonhunshin
UnsupportedOperationException If the device does not have Telephony feature calling, the some of interfaces in TelephonyManager throw UnsupportedOperationException. Bug: 297989574 Test: oriole with ATT SIM, boot completed APM/data/wifi on/off Change-Id: I85f935d726ba23085d429a51960ddd4bfcd0adee
2023-08-03Remove GnssNi related code Yu-Han Yang
Bug: 294306993 Test: on device Change-Id: I5561796c73247a62385792e1976f66fba3bad381
2023-03-09Update AltitudeConverter assets and references to be consistent with ↵ Brian Julian
external documentation. Relnote: N/A Bug: 272491372 Test: atest FrameworksMockingServicesTests:AltitudeConverterTest CtsLocationNoneTestCases VtsHalAltitudeServiceTargetTest Change-Id: I47702ae82bfa1cc0a35501d56233ab77a8f77547
2022-12-14Adds hidden AltitudeConverter.addMslAltitudeToLocation(Location) that does ↵ Brian Julian
not load data from raw assets. Relnote: N/A Bug: 231327615 Test: atest FrameworksMockingServicesTests:AltitudeConverterTest Change-Id: Idb699d03035c7ec56a07f3c648f49119b014363f
2022-12-06Removes catch on IOException as GeoidHeightMap#loadFromCacheAndDisk supports ↵ Brian Julian
this type of throw. Relnote: N/A Bug: 231327615 Test: atest CtsLocationNoneTestCases Change-Id: I7a89f51d60837f709dce9b28afd1b52c49c339cf
2022-12-02Adds complete U implementation of AltitudeConverter. Brian Julian
Relnote: N/A Bug: 231327615 Test: atest CtsLocationNoneTestCases Change-Id: I7bac8b12ddd68732f99ff04e30f169657c2d2e71
2022-07-20Handle emergency SUPL on active SIM Yu-Han Yang
- Call setSetId on the active sub ID in emergency SUPL - Reload GNSS configurations when emergency call starts and ends Bug: 211060538 Test: manual Change-Id: I4d61854644e851bb742eff0e89826a2d0e5284d6
2021-11-03Use TelephonyCallback to replace the deprecated broadcast Yu-Han Yang
Bug: 196115028 Test: manual Change-Id: I53e8053d7f03e3263986d4e8ce03ebfbcfd79316
2021-01-08Copy LocationProviderBase API into SystemApi surface Soonil Nagarkar
This allows third party location providers to link against the standard API surface. This replaces the LocationProviderBase implementation in the com.android.location.providers API. Both will temporarily coexist until third party applications can be migrated, and then old version will be removed. Only the LocationProviderBase API is migrated right now as its the only API that has undergone changes. This also restores some old, unused classes which should not have been remove from the API surface. Clients that support older API version will still need to link against these classes. Bug: 176115245 Test: builds Change-Id: I2d688447e1f59e441f5c48ff36d3f0dd8b5dc7f6
2021-01-06Merge "Delete location.timezone.provider API classes" Neil Fuller
2021-01-05Refactor Java GNSS HAL Soonil Nagarkar
Extracts large parts of the GNSS HAL into a central GnssNative class, which can be faked for testing. This is a large step towards making all GNSS code unit testable, and allows for more modular HAL configurations. Begins to break up the GnssLocationProvider god object and pull functionality out into other classes. Changes include: -Making GnssCapabilities parcelable so it can be part of the API -Splitting out the NMEA listener from status listeners, which substantially reduces the burden of supported NMEA listeners as well as the amount of GNSS<->AP communication. -All GNSS listeners now respond properly to HAL restarts. -Partially extract out emergency call detection. Bug: 153129152 Test: manual Change-Id: Idee0d548f38c6adf921cd6c28b5d815bbd366f8a
2021-01-05Merge "Replace LocationProvider with ProviderProperties" TreeHugger Robot
2021-01-05Delete location.timezone.provider API classes Neil Fuller
Delete location.timezone.provider API classes and associated internal classes that are no longer used. Bug: 175633818 Test: build Change-Id: I66319e63e3150e3b71f31f8d9404e4114f802662
2020-12-29Clean up dead code in NetInitiatedActivity Yu-Han Yang
Bug: 174151048 Test: on device Change-Id: I5a3a77557720571b455ffec296cdd4e2e1a02f7b
2020-12-28Replace LocationProvider with ProviderProperties Soonil Nagarkar
LocationProvider cannot represent unknown properties, which is currently causing problems with getProvider() which may return null even when a particular provider exists. Instead provide isProvider() to query whether a provider exists, and getProviderProperties() to query a provider's properties. Bug: 176232308 Test: atest CtsLocationNoneTestCases Change-Id: Ic42cc953624be116616b0b997e18356247fdf288
2020-12-15Move NUM_GPS_SIGNAL_QUALITY_LEVELS to GnssSignalQuality Soonil Nagarkar
This allows us to move GnssMetrics out of the client in a follow up CL. Test: compiles Change-Id: Idce044199f2ce223f893bfaecf43e5043a83bb94
2020-11-25Change LocationTimeZoneEvent elapsed realtime Neil Fuller
Switch LocationTimeZoneEvent to elapsedRealtimeMillis from nanos. This makes it more consistent with other usages of the elapsed realtime clock in time zone detection. This information is currently only used for debug so there will be no functional change. Also change LocationTimeZoneEvent toString() to additionally report mElapsedRealtimeMillis value using Duration.toString(); this is done elsewhere in debug output for time zone detection so makes understanding log output easier. Bug: 169304499 Test: build only Change-Id: If307c9b27d64ca49a4fcc0d9bb6e36f362990b3e
2020-11-24Move LocationTimeZoneEvent to com.android Neil Fuller
LocationTimeZoneEvent was originally supposed to fulfil the same role as Location does in the LocationProvider. Since Location is public SDK, it was in android.location. LocationTimeZoneEvent is not public SDK (or any form of API), so it can be moved to com.android instead. LocationTimeZoneEventUnbundled is in the API in its place. Bug: 169304499 Test: treehugger only Change-Id: I5d382362383000b16852928895a18ac4e4269a8f
2020-11-10Add batching APIs and Location.equals() Soonil Nagarkar
-Moves batching APIs from SystemApi to Public, and makes them multi-client safe. -Adds equals/hashcode to Location. Bug: 171512333 Test: manual + presubmit Change-Id: I6ee28f8229fdf49386cd370ea785de63b97e7cde
2020-10-14Add quality to LocationRequest/ProviderRequest Soonil Nagarkar
Expose quality APIs publically after refactoring them to match external usage of quality constants. Removes list of location requests from provider request, as there is no client that really uses this, and it feels like too much information to give to providers. Bug: 168624248 Test: presubmits Change-Id: Icf8a9f6096da0071d97190d3f7196948492e52a1
2020-10-13Use TelephonyManager#isEmergencyNumber() instead Taesu Lee
Replace deprecated PhoneNumberUtils#isLocalEmergencyNumber() and isEmergencyNumber() with TelephonyManager#isEmergencyNumber(). Test: Build Bug: 132703886 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com> Change-Id: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
2020-09-24Tidy up the "unbundled" provider API Neil Fuller
This commit introduces a LocationTimeZoneEventUnbundled, as LocationTimeZoneEvent will not be on another API surface so cannot be reused. (The equivalent from LocationProvider is Location, which is public API so there is no LocationUnbundled.) Add an initialization timeout to LocationTimeZoneProviderRequest so that providers can make intelligent choices about (for example) how long to spend waiting for geolocation to happen passively. Test: atest services/tests/servicestests/src/com/android/internal/location/timezone/ Test: atest services/tests/servicestests/src/com/android/server/location/timezone/ Bug: 152744911 Change-Id: Id3e9e6916e8c3a132d8fc892338578ab9d2ff574
2020-09-15Fix up provider internal/external APIs Soonil Nagarkar
-Encapsulate various fields -Bring naming in line with API guidelines -Minor refactoring Bug: 168621146 Test: manual Change-Id: I55681a3d84d7833c98569a13a57e6c4f0b728a67
2020-07-14Replace manual creation of StatsEvent objects with their appropriate ↵ Salud Lemus
buildStatsEvent() method 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
2020-07-09Ask location provider for its package name Soonil Nagarkar
The package name from the service watcher may be inconsistent with the package name of the currently bound service. Test: none Change-Id: Iede437d2e61a0da0b853fdbb133a29add04f6bf3
2020-06-22Various small fixes Soonil Nagarkar
Test: manual Change-Id: Id9874dd034aae96d540fac7c580c6689e25f44e8
2020-06-09Merge "Remove unused intent in NiNotification" into rvc-dev am: e93814953c ↵ TreeHugger Robot
am: ebaf86bece am: c6e39e749d am: 6200c35d5b Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11799318 Change-Id: I23e0430e37ab8714fb35389d269dc7c8a6c99986
2020-06-09Merge "Remove unused intent in NiNotification" into rvc-dev TreeHugger Robot
2020-06-08Remove unused intent in NiNotification Yu-Han Yang
Bug: 154319182 Test: manual Change-Id: I5958a8fb442cf4506e1824243493f91aea34a7cc
2020-06-08Merge changes I6c0940fd,I1b2dc636 into rvc-dev am: 01d150e539 am: fdd1c9d081 ↵ Ruchir Rastogi
am: f40041df55 am: f1d8c17883 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11727208 Change-Id: I6623d52ca3265652dcafdf8c4a15ce2ccb2936b0
2020-06-05Move GnssStats puller to binder thread Ruchir Rastogi
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
2020-06-05Partial CP of ag/10846962 Ruchir Rastogi
CP to rvc-dev to avoid automerger conflicts for ag/11727208. Test: m Bug: 157186182 Change-Id: I1b2dc636b90e6a643a2d5722022671563955f96a Merged-In: I1eb1dfb68190c68e896e87c5bea1f2ec44065e80
2020-05-19Remove LocationTimeZoneProviderRequest.workSource Neil Fuller
Remove LocationTimeZoneProviderRequest.workSource and correct some docs. Bug: 152744911 Test: treehugger only Change-Id: Ibd26886a1c4e66507bbcaafc5132b615e5af443e
2020-04-09Merge "Rename ILocationProviderManager method" Soonil Nagarkar
2020-04-09Merge "Minimal skeleton for location time zone providers" Neil Fuller
2020-04-08Rename ILocationProviderManager method Soonil Nagarkar
Test: presubmit Change-Id: Ib2b0fd5c2065e85b390815fad6a2d7e04b81afb7
2020-04-08Minimal skeleton for location time zone providers Neil Fuller
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-02Merge "Fix up LocationRequest and ProviderRequest" into rvc-dev am: ↵ Soonil Nagarkar
240eaaaaab am: 293347f282 am: 14f734fbed am: d8f077de28 Change-Id: I49e0d5ec63fca56395fee5463633c21cff73f06d
2020-04-01Fix up LocationRequest and ProviderRequest Soonil Nagarkar
-Use more idiomatic and efficient parceling -Cleanup LocationRequest a bit Bug: 151026407 Test: presubmits Change-Id: I3865421a128417a5096e39ee110139a13ab9ab3b
2020-03-26Make GnssStatus a Parcelable Soonil Nagarkar
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-11Add equals() to ProviderProperties Soonil Nagarkar
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-07Merge "Address Puller API Feedback" into rvc-dev am: 8651b62518 am: ↵ Automerger Merge Worker
eff89f9fcf am: c7a97df065 am: 6776affc26 Change-Id: Ib42990a37d5b00945f4e662554853d47ff1ee86e
2020-03-05Address Puller API Feedback Tej Singh
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