Commit Graph

972 Commits

Author SHA1 Message Date
Yu-Han Yang
4ff8affb7c Merge "Add GnssAutomaticGainControl to GnssMeasurementsEvent (frameworks/base)" 2022-01-14 22:07:59 +00:00
Yu-Han Yang
af90af7931 Add GnssAutomaticGainControl to GnssMeasurementsEvent (frameworks/base)
AgcLevelDb has been a subfield of GnssMeasurement. However,
GnssMeasurement is only reported by the chipset when there
is GNSS signal. For example, in deep indoor, or when there
is strong jamming signal, no GnssMeasurement can be reported,
and thus no AGC value can be reported.

To resolve that, we are adding this GnssAgc to GnssMeasurementsEvent
directly, so that the client can get AGC values even without GNSS
signal (i.e., without GnssMeasurement).

Bug: 206670536
Test: atest GnssAutomaticGainControlTest
      atest GnssMeasurementsEventTest
Change-Id: I97c7ec98b6e8cc977c6e879b52a8cf75c355ae33
2022-01-14 09:54:38 -08:00
Soonil Nagarkar
967a70e580 Merge "Add missing javadoc param" 2022-01-14 02:20:51 +00:00
Soonil Nagarkar
36063b228b Add missing javadoc param
Bug: 214389219
Test: presubmits
Change-Id: I0328b640378efab4c41c76f5a9bcce557339fc1a
2022-01-13 11:03:16 -08:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Soonil Nagarkar
471b107d52 Merge "Ensure location provider exceptions are visible" 2022-01-11 00:17:40 +00:00
Soonil Nagarkar
a25ac6d49b Ensure location provider exceptions are visible
Exceptions thrown on one-way binder threads are dropped and ignored,
which is very harmful to writing stable code. Rethrow any exceptions
from these binder calls on the main thread to crash the process.

Test: presubmits
Change-Id: Ie5986061c6d664f59b83679c90dd07adad1a7ec2
2022-01-10 12:14:34 -08:00
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
54cfe9208c Merge "Use TelephonyCallback to replace the deprecated broadcast" 2021-11-04 17:47:43 +00: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
Yu-Han Yang
1096bce6b8 Use TelephonyCallback to replace the deprecated broadcast
Bug: 196115028
Test: manual
Change-Id: I53e8053d7f03e3263986d4e8ce03ebfbcfd79316
2021-11-03 13:40:09 -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