Commit Graph

1009 Commits

Author SHA1 Message Date
TreeHugger Robot
5f17a4e8d2 Merge "Handle emergency SUPL on active SIM" into tm-d1-dev am: 45811541cf am: 5e93561cb9 am: af45c48f8e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19290988

Change-Id: Ifd73b36a9012f6fb370c2aa6a656cac3ed0d7226
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-22 19:34:13 +00:00
TreeHugger Robot
45811541cf Merge "Handle emergency SUPL on active SIM" into tm-d1-dev 2022-07-22 18:33:15 +00:00
Yu-Han Yang
894d6e63e3 Handle emergency SUPL on active SIM
- 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
2022-07-20 20:11:20 +00:00
Yu-Han Yang
70f5d083ce Correct the range of issueOfDataEphemeris as [0, 1023]
Bug: 239083503

Test: atest SatellitePvtTest
Change-Id: I017b4e83a6af61c7827c9135176953809b139bb7
Merged-In: I017b4e83a6af61c7827c9135176953809b139bb7
2022-07-14 23:48:48 +00:00
Yu-Han Yang
522fcc0f80 Correct the range of issueOfDataEphemeris as [0, 1023]
Bug: 219575003
Test: atest SatellitePvtTest
Change-Id: I017b4e83a6af61c7827c9135176953809b139bb7
2022-07-14 22:01:01 +00:00
mattgilbride
f48d794e01 @EnforcePermission migrations - services.core
Immediate calls to Context.enforceCallingPermission.  Fixes
applied by Android Lint (ag/18432857).

Bug: 232058525
Test: N/A
Change-Id: Id9bdeb71e84962d55fd1657e91856d84e1c3d11b
2022-07-11 20:01:27 +00:00
Hani Kazmi
4f221e5c51 Migrate Bundle/Intent APIs to new, type checked, variants
Part of go/safer-parcel. Follow up to ag/16639043. Migrates the following unsafe APIs:

* Parcel.readArray()
* Parcel.readParcelableArray()
* Bundle.getSerializable()
* Bundle.getParcelable()
* Bundle.getParcelableArrayList()
* Bundle.getParcelableArray()
* Bundle.getSparseParcelableArray()
* Intent.getSerializableExtra()
* Intent.getParcelableExtra()
* Intent.getParcelableArrayExtra()
* Intent.getParcelableArrayListExtra

Bug: 227458983
Test: m and presubmit pass
Change-Id: I72f206cb18eb5c669a7fff07a6845bed1c433fdb
2022-07-01 10:53:53 +00:00
Austin O'Neil
3011a698a3 Merge "Update deprecation links in LocationManager to point to non-deprecated methods." 2022-06-22 22:57:00 +00:00
Soonil Nagarkar
fd665da1fc Merge "Add javadocs update on Android R crash" 2022-06-22 20:02:34 +00:00
Austin O'Neil
1959247484 Update deprecation links in LocationManager to point to non-deprecated methods.
Test: this is a documentation update
Change-Id: I42318b722b9e9cf73e9efee60f43a1dfd5dbcbd8
2022-06-21 23:48:17 +00:00
Soonil Nagarkar
e60263fae5 Add javadocs update on Android R crash
Bug: 233111834
Test: na
Change-Id: I017113a22295106bbca3844761a512cd6ae057e1
2022-06-21 16:23:37 -07:00
Soonil Nagarkar
ba6cff9834 Update location package javadocs
Test: none
Change-Id: Iac8a189a5773784305cfd5ea2af4414030167d12
2022-06-07 11:49:35 -07:00
Brian Julian
e65cbd316b Updates to Location class for Android U as discussed in go/android-context:msl-on-android.
Adds to fields to represent altitude above Mean Sea Level and its accuracy.

Test: existing unit tests still pass

Bug: 231327615

Change-Id: I779653937160f01dfdbc19e5e7921758964b9623
2022-05-10 01:36:47 +00:00
Brian Julian
16560c0930 Add a permissions check to LocationManagerService.
Prevents apps from reading location requests of other users without INTERACT_ACROSS_USERS permission.
Bug: 222473855
Test: Build

	modified:   services/core/java/com/android/server/location/LocationManagerService.java

Change-Id: Id591cd39ed7813c649b44d4a3210f0b1fb79b40d
2022-05-03 12:30:22 +00:00
Soonil Nagarkar
7dcdb109b9 Deprecate some Criteria APIs missed the first time
Continue deprecating all Criteria APIs.

Bug: 229871756
Test: Manual
Change-Id: I40f797b9830acd0962e98678a77d970b36cbaffc
2022-04-21 11:04:30 -07:00
Grace Cheng
c96bd77dd1 Merge "Switches ADAS allowlist away from string resources" into tm-dev 2022-04-05 01:21:34 +00:00
Grace Cheng
dea5248299 Switches ADAS allowlist away from string resources
Bug: 226440115
Test: manually

Change-Id: I3d1434c405a1babee999533afa10710a06f635a1
2022-04-04 15:38:00 +00:00
David Christie
c80684b7c1 Merge "Update location OWNERS files" am: b3249c820f am: d0e5951d42 am: 731c34c0e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2042803

Change-Id: Ia817c9d3e70e11f1e15861e272ea7d861ce996af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-29 15:31:34 +00:00
David
b84bb82fbc Update location OWNERS files
Test: N/A
Change-Id: I4a2871228a179eb80f556719aae0a78fca1616da
2022-03-28 09:25:17 -07:00
Grace Cheng
6f99e1a33d Adds RequiresFeature annotation to ADAS APIs
Bug: 215299508
Test: presubmit

Change-Id: Iaa29a383613b48ef7baa7fd8cd73b8fbf797d6bb
2022-03-25 03:37:08 +00:00
Grace Cheng
329d712936 Merge "Removes WRITE_SECURE_SETTINGS from location bypass APIs" into tm-dev 2022-03-19 08:36:07 +00:00
Yu-Han Yang
1257c4108a Merge "Add GnssExcessPathInfo (frameworks/base)" into tm-dev 2022-03-17 16:31:42 +00:00
Grace Cheng
a7bf3a7b5b Removes WRITE_SECURE_SETTINGS from location bypass APIs
Bug: 215299508
Test: presubmit

Change-Id: Ice5e28858efa07c4bea5540aad8bb0bcf0a69137
2022-03-16 23:09:58 +00:00
Yu-Han Yang
97f3b91c53 Add GnssExcessPathInfo (frameworks/base)
Also add combinedAttenuationDb in GnssSingleSatCorrection

Bug: 201253590
Test: atest GnssExcessPathInfoTest
      atest GnssSingleSatCorrectionTest
Change-Id: I7f629f2fbca563a36d1b4543f768b8fabd5d91fd
2022-03-16 12:11:22 -07:00
Soonil Nagarkar
91e3a080aa Update Location APIs per feedback
Bug: 200730770
Test: presubmits
Change-Id: I251dcce3bae431ab3770e0610105c75e377c8d10
2022-03-15 16:46:14 -07:00
Yu-Han Yang
091f9b53f5 Append 'Seconds' to timeOfClock and timeOfEphemeris
Bug: 219575003
Test: atest SatellitePvtTest
Change-Id: I28d1e5b16db8b5f75015c54bcfcc391a6a50082b
2022-02-25 21:12:13 +00:00
TreeHugger Robot
0d4e785115 Merge "Change TimeOfClock and TimeOfEphemeris to long" 2022-02-16 23:31:11 +00:00
Yu-Han Yang
979a2b76a3 Change TimeOfClock and TimeOfEphemeris to long
Change TOC and TOE definition to
1. long
2. time in seconds since GPS epoch, regardless of constellation
3. must not be encoded

Bug: 219575003
Test: atest SatellitePvtTest
Change-Id: Ic663e45adafbd1778528a985c1670898d5653e00
2022-02-16 11:00:02 -08:00
Neil Fuller
490d480a95 Switch "UTC time" to "Unix epoch time" (Location)
This is more correct. Android devices, even under ideal conditions,
don't track UTC (which contains leap seconds and uses the SI definition
of a second) but use a clock based on Unix epoch time (no leap seconds,
but clocks may skip/stop or smear around leap seconds to ensure a fixed
number of second increments per calendar day when leap seconds are
applied to UTC).

Bug: 218802673
Test: Compile only
Change-Id: If87023af06ba9933f96029e52df9cb3841bca0cb
2022-02-11 11:29:05 +00:00
Grace Cheng
74bfabdade Adds LOCATION_BYPASS permission.
Bug: 215299508
Test: presubmit

Change-Id: I3768fb7bcc8da64ddad1d2e0a4bb3feaec244104
2022-01-28 01:33:30 +00:00
Eva Chen
b9314e1681 Merge "Update GNSS S2R APIs based on API Council feedback." 2022-01-27 23:05:30 +00:00
Yu-Han Yang
c8b3508deb Merge "Add ephSource, toc, toe, IODC, IODE to SatellitePvt (frameworks/base)" 2022-01-26 18:53:47 +00:00
Eva Chen
a10ba7bb2c Update GNSS S2R APIs based on API Council feedback.
Bug: 215304589
Test: atest GtsLocationTestCases:AutomotiveGnssControlsTest
Change-Id: Ie1ff0698df9e23fa280fbbf71f1330bdf14f5f2c
2022-01-25 12:58:55 -08:00
Yu-Han Yang
e088750093 Add ephSource, toc, toe, IODC, IODE to SatellitePvt (frameworks/base)
Bug: 206670536
Test: atest SatellitePvtTest
Change-Id: I3b4f084bc2a0b1e7603acb49f9bfbad1dbd441bb
2022-01-24 14:41:12 -08:00
Soonil Nagarkar
abb7ac8e60 Change default LocationRequest quality
In order to maintain backwards compatibility with SystemApi versions of
LocationRequest, we chose to keep the default quality level as low.
However, this is causing problems when LocationRequests are created
through the use of legacy public APIs, leading to location requests that
do not receive locations as expected. Default the quality level to
balanced to address this issue.

Also removes old UnsupportedAppUsage annotations (past the 2 release
support limit now), and updates some variable names accordingly.

Bug: 215186921
Test: presubmits
Change-Id: I6e1fdb0b94438fd3dede75103cd70443e863a3f2
2022-01-24 12:42:11 -08:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

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
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
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