Commit Graph

743 Commits

Author SHA1 Message Date
Lee Shombert
9a686c07ba Merge "Prepare PropertyInvalidatedCache for SystemApi" 2022-01-06 23:14:05 +00:00
TreeHugger Robot
855774347e Merge "Fix parcel creation bug in GnssSingleSatCorrection" 2022-01-05 17:40:24 +00:00
Yu-Han Yang
3ce77a50da Fix parcel creation bug in GnssSingleSatCorrection
Bug: 211497888
Test: atest GnssSingleSatCorrectionsTest
Change-Id: I7687ffa68d463c943606d3e20a7253fa70211ead
2022-01-04 17:23:00 -08:00
Yu-Han Yang
799b03522c Add intervalMs to GnssMeasurementRequest
Bug: 206670536
Test: atest GnssMeasurementRequestTest
Change-Id: I131c8f0f931d4f7cc57bd34009aa27961eadcf3c
2022-01-04 09:51:44 -08:00
Lee Shombert
0cece3898b Prepare PropertyInvalidatedCache for SystemApi
Bug: 152453213
Tag: #refactor

This commit prepares PropertyInvalidatedCache to function as a system
api.  Specifically, the methods recompute() and bypass() which may be
overridden by clients are now public (instead of protected).  This
forces an update to all existing clients, to accommodate the change in
method visibility.

Two small changes have been made as cleanup:

 1. The awkwardly named debugCompareQueryResults() is now
    resultEquals(), which is more or less consistent with how other
    equality tests are named in Android.  This name change affects two
    clients.

 2. PackageManager has changed to use resultEquals() instead of
    maybeCheckConsistency().  This provides a simpler and more
    consistent use of the APIs.  maybeCheckConsistency() has been made
    private.

Test: atest PropertyInvalidatedCacheTests

Change-Id: I4110f8e887a4fd8c784141e8892557a9d1b80a94
2022-01-04 08:13:59 -08:00
Bernardo Rufino
90bb3709dc Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Test: TH passes
Change-Id: I11a27b9bdab7959ee86e90aa1e1cbebd7aaf883c
2021-12-15 18:21:38 +00:00
Eva Chen
f65956e872 Merge "Implement GNSS APIs for Automotive Power Management." 2021-11-18 17:40:03 +00:00
Yu-Han Yang
d43b242660 Update wording about high GNSS accuracy applications
Test: javadoc only
Bug: 199933846
Change-Id: I2517910db88df90d9cafcf0e07b9384a1e9e2ec4
2021-11-08 11:25:34 -08:00
Eva Chen
c6a673d409 Implement GNSS APIs for Automotive Power Management.
Automotive Suspend to RAM doesn't work when GNSS requests are
actively running. This change introduces system APIs for suspending
and resuming GNSS.

Bug: 187348886
CTS-Coverage-Bug: 203703449
Test: Presubmits
Change-Id: If25c761e8618bebaf989392afc0a676f930dfd78
2021-11-04 14:20:32 -07:00
Yu-Han Yang
fee50f1946 Clarify GNSS location is at the primary antenna
Bug: 199933846
Test: doc only
Change-Id: Ie883e0c221c8a5e28eaaa7feed6aea7b6003fab0
2021-11-03 13:57:43 -07:00
TreeHugger Robot
82521f588e Merge "Fix serialization bug in GpsNavigationMessage" 2021-09-30 00:00:45 +00:00
TreeHugger Robot
6b21c0accc Merge "Add asynchronous geocoding API" 2021-09-23 17:48:22 +00:00
Yu-Han Yang
dedaa90193 Fix serialization bug in GpsNavigationMessage
Bug: 196970023
Test: presubmits passing.
Change-Id: I69f51eb2faac0cf2ee9f7a5f94f7100925f7221c
2021-09-22 01:49:23 +00:00
TreeHugger Robot
e74dd0a572 Merge "Fix the link of addNmeaListener" 2021-09-21 19:01:47 +00:00
Yu-Han Yang
1fadf4d3b5 Fix the link of addNmeaListener
Bug: 157630227
Test: javadoc update only
Change-Id: Iccd8695572cd94c3ffe00b04445a026edf79ee88
2021-09-16 09:16:20 -07:00
TreeHugger Robot
ee88e0946e Merge "Clarify GnssAntennaInfo should be provided by OEM" 2021-09-15 04:31:06 +00:00
TreeHugger Robot
f3afe1a3c3 Merge "Update 'GPS message' to 'GNSS message'" 2021-09-10 18:05:04 +00:00
Yu-Han Yang
9786469624 Clarify GnssAntennaInfo should be provided by OEM
Bug: 193069052
Test: doc update only
Change-Id: I1c72469db4b67c6fd030b7fa93bde2d31fec140d
2021-09-09 21:37:55 +00:00
Yu-Han Yang
085701dcf9 Update 'GPS message' to 'GNSS message'
Bug: 197542267
Test: Javadoc update only
Change-Id: I6699c1f4e5b2df205fcd4762338a7e8e4cf63204
2021-09-09 14:21:39 -07:00
Soonil Nagarkar
03e0b89362 Add asynchronous geocoding API
Geocoding is unsupported, but the old APIs encourage bad behavior and
force clients to waste a thread blocking for results. This often causes
ANRs in a variety of applications. Provider an asynchronous API so
clients can avoid ANRs.

Bug: 197585308
Test: presubmits
Change-Id: I6fdd90d467f01892ce34371c2161721bd5976ca9
2021-08-30 14:49:50 -07:00
Soonil Nagarkar
b6c2e496a9 Refactor Location.java
Apply API best practices, fix infinite loop in setBearing(), fix up
javadocs and rewrite some tests.

Bug: 187142700
Test: atest LocationTest + presubmits
Change-Id: I75decc7b167b90b5a22e718848259d454db7a08b
2021-08-27 10:46:52 -07:00
TreeHugger Robot
5e98f82037 Merge "Allow negative value for CorrelationVector#samplingStartM" into sc-dev am: a5117ca3b4 am: da458457e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15515230

Change-Id: I34512dbaaf6157e347cd829166c0a3b52844873e
2021-08-12 07:53:47 +00:00
TreeHugger Robot
a5117ca3b4 Merge "Allow negative value for CorrelationVector#samplingStartM" into sc-dev 2021-08-12 07:17:47 +00:00
TreeHugger Robot
16ddb33a04 Merge "Fix Location equals()" into sc-dev am: b42181c3be am: eed95743b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15519010

Change-Id: Ia246af3a63cfa3726f0ab13b1f0c00b56ac08386
2021-08-11 02:21:10 +00:00
TreeHugger Robot
b42181c3be Merge "Fix Location equals()" into sc-dev 2021-08-11 01:52:31 +00:00
Soonil Nagarkar
271b907bab Fix Location equals()
Should handle extras in a better manner.

Bug: 196075248
Test: presubmits + manual
Change-Id: I89e45c289b26ea97486c5a72feb0a805c8c1a950
2021-08-10 14:25:39 -07:00
TreeHugger Robot
fce866d7b0 Merge "Log locations received by default and add javadocs" into sc-dev am: 35260c6f60 am: b4c5930034
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15517616

Change-Id: I6856edaea26cc2356a13471c1c9810946da2bb12
2021-08-10 19:08:00 +00:00
Soonil Nagarkar
309ab3bb49 Log locations received by default and add javadocs
Logging received locations was originally removed over fears it would be
too spammy, but it is proving too difficult to debug without at least
some logs here.

Bug: 196053011
Test: manual
Change-Id: Ie18baa26daca9ad761125ad07a734f27fabfd89e
2021-08-10 09:58:31 -07:00
Shinru Han
e19a11cf6f Allow negative value for CorrelationVector#samplingStartM
Bug: 195934893
Test: atest ctsLocationPrivilegedTestCases
Change-Id: I255e118cabf274811b57e88a35faf8c9e697d8ae
2021-08-10 10:36:53 +00:00
TreeHugger Robot
1f862b0ac0 Merge "Expose ADAS APIs" 2021-07-19 23:08:10 +00:00
Grace Cheng
1da6f0eb49 Makes injectLocation a system api to suport car stack mainline
updatability.

The detailed reason why we do this is explained in the bug.

Bug: 192377485
Test: build

Change-Id: If5a800257cd3a875de208f8142ef5b4e88a05dbe
2021-07-14 15:35:51 -07:00
Soonil Nagarkar
a2f2565353 Expose ADAS APIs
Bug: 156688086
Test: presubmits
Change-Id: Ie7256019b5073b2c5761677bbfa31c33d13957d7
2021-06-23 17:47:41 -07:00
Soonil Nagarkar
e58fea5a45 Add ADAS GNSS bypass functionality
ADAS applications on automotive device require a way to access GNSS
sensors even when the master location toggle is off, so that they can
provide automotive safety services.

Bug: 156688086
Test: atest LocationProviderManagerTest
Change-Id: I438a781b2202c488da97f7ea732f87403d1068e4
2021-06-23 11:11:50 -07:00
Yu-Han Yang
cfd524f1b6 Merge "Fix ADR half cycle ambiguity doc (frameworks/base)" into sc-dev 2021-06-22 19:07:51 +00:00
TreeHugger Robot
d0595d18d1 Merge "Replace "satellite" with "satellite signal" in doc" into sc-dev 2021-06-18 16:02:27 +00:00
Sasha Kuznetsov
3e4cfb9ac7 Fix ADR half cycle ambiguity doc (frameworks/base)
Bug: 190846015
Test: N/A
Change-Id: Ib954ac948f7e2ac4684bcc02b553bb2a3c61e853
2021-06-17 09:53:24 -07:00
Yu-Han Yang
327919c2dc Replace "satellite" with "satellite signal" in doc
Bug: 190263418
Test: doc update only
Change-Id: I0bec883c5b64d3e9fb2b7e3436aef3cc58a7e53a
2021-06-16 14:34:28 -07:00
Soonil Nagarkar
a244ceeb2e Merge "Fix bugs in LocationManagerService and AppOpsPolicy" into sc-dev 2021-06-16 15:37:32 +00:00
Soonil Nagarkar
4aa42bdb17 Fix bugs in LocationManagerService and AppOpsPolicy
LocationManagerService was overwriting location source appops tag
information whenever a location provider changed state. Since multiple
location providers can correspond to the same uid/app id, this could
lead to loss of tags. This is fixed by recalculating the set of tag for
an entire app id any time a uid changes.

AppOpsPolicy had a bug where tag lists coming from different uids under
the same appid would inappropriately overwrite each other. This is fixed
by modifying the internal/external APIs to work in terms of appid rather
than uid, so that it is someone else's responsibility to ensure the
result is valid for the app id as a whole.

Also fixes a bug where LMS assumes tag listeners are added prior to any
providers. If listeners are added after some providers they will miss
updates. Fixed by always updating the listener on registration.

Bug: 190073375
Test: manual
Change-Id: Ib52d752d857b6ac3b6683186a8d1bbcb814fb798
2021-06-15 08:45:44 -07:00
Soonil Nagarkar
08cb5412af Minor eventlog and LocationProviderBase cleanups
Change eventlog behavior solely based on logging properties, not the
debug build. This allows for reduced logging even on debug builds. Minor
updates to LocationProviderBase.

Bug: 190609486
Test: manual
Change-Id: I1efb28663de7ddd4224b01afe195baf3ff78ddb0
2021-06-09 17:29:11 -07:00
Soonil Nagarkar
59b24345c9 Revert implict min update interval to 1/6 of interval
Keeps same behavior from previous releases.

Bug: 190427917
Test: none
Change-Id: I5f80bbe202ce1137c702e90f2b54a285a7628c94
2021-06-07 14:57:29 -07:00
Jeff Sharkey
725a2ea256 Clean up "Deprecated at Birth" APIs.
When APIs are refactored mid-release, they can often be left marked
as @Deprecated with the intention of eventually removing them before
the SDK is finalized.

Well, the time has come to finalize the SDK, so let's clean them up.

Bug: 189325658
Test: manual
Change-Id: I48e3e1c1306fbaf071e4acfd9e8107e6ad564ffe
2021-05-26 13:09:00 -06:00
Joe Huang
9d78bec9fa Merge "SatellitePvt API council review" into sc-dev 2021-05-22 04:46:24 +00:00
Joe Huang
8945fbb3a1 SatellitePvt API council review
Remove getFlags/setFlags, determining the flag in Java side

Bug: 188798284
Test: atest CtsLocationPrivilegedTestCases, also try setting different flags in HAL to see if CTS can be passed.
Change-Id: I231148b62404ee4873da60546eebb75d83fae9a7
2021-05-22 02:02:53 +08:00
Soonil Nagarkar
1ea818347e Update location bypass allowlist
Create a new DeviceConfig entry to replace the prior Settings entry on
which the location ignore settings allowlist is based. This allows us to
allowlist based on attribution tag, and eliminate holes for large
applications.

Test: manual + CTS + GTS
Bug: 187421886
Change-Id: I31e61db79b93e202bd8c66efae1bb5aaf0c88ff5
2021-05-21 09:25:47 -07:00
Joe Huang
ce10acd0af Add valid satellite PVT fields in JNI & framework
Bug: 187145250
Bug: 188225075
Test: atest CtsLocationPrivilegedTestCases, also try setting different flags in HAL to see if CTS can be passed.

Change-Id: Ie5e11ebd5516dffcf80373805a7b37668f7db8a0
2021-05-15 04:23:17 +00:00
Joe Huang
88385cc1f0 Merge "Add additional doc for SatellitePvt" into sc-dev 2021-05-10 17:07:40 +00:00
Yu-Han Yang
83a305a089 Merge "Revert "Remove dynamic location settings footer"" into sc-dev 2021-05-08 15:58:10 +00:00
Yu-Han Yang
7b1f58ce2d Revert "Remove dynamic location settings footer"
Revert "Remove dynamic location settings footer"

Revert submission 13809184-location_footer

Reason for revert: b/187211885

Reverted Changes:
Iaf14044e0:Remove dynamic location settings footer
Ifa6468b11:Remove dynamic location settings footer
If3ab49241:Remove dynamic location settings footer

Bug: 187211885

Change-Id: Ib53c42b3583fd93c87d21feb9882f3431b133d40
2021-05-08 15:57:26 +00:00
Joe Huang
027bb813be Add additional doc for SatellitePvt
Bug: 183239007
Test: atest CtsLocationPrivilegedTestCases
Change-Id: I30a0ff67c2523ab08505c2761594b64f48c23a21
2021-05-08 04:51:52 +00:00