Commit Graph

912 Commits

Author SHA1 Message Date
TreeHugger Robot
bc8bb62683 Merge "Fix cache by userId bugs" into sc-dev 2021-05-03 18:40:52 +00:00
Soonil Nagarkar
da4d1c3639 Fix cache by userId bugs
Three bugs were present here:

1) isLocationEnabled() will return incorrect results for USER_CURRENT
and USER_CURRENT_OR_SELF
2) Disabling the location enabled cache does not work properly in the
system process, we only disable the cache for a single instance of
LocationManager.
3) isLocationEnabled() was not respecting the user as defined by the
context used to create the LocationManager.

Bug: 185401689
Test: atest CtsLocationFineTestCases
Change-Id: I84bff02604a4b2d84494a0e099e172c4ffb400a2
2021-04-29 12:44:03 -07:00
TreeHugger Robot
d582f3d1c3 Merge "Clarify ISB sign in Javadoc" into sc-dev 2021-04-28 02:24:54 +00:00
Yu-Han Yang
331748aa07 Clarify ISB sign in Javadoc
Bug: 162508535
Test: doc update only
Change-Id: I3267a8b02d47e780cf1124a0882a26958383dd5f
2021-04-27 09:36:40 -07:00
Soonil Nagarkar
ad53af1fa7 Update Geocoder docs to strengthen warnings
Bug: 177616061
Test: none
Change-Id: I81bcd4530fd7064ade8be00e0ad6d126cb9ab6f6
2021-04-22 19:05:50 -07:00
Soonil Nagarkar
1cfbcfef5c Update location time docs
Updates various docs around location time, and also fixes up some
deprecated method usage.

Bug: 184726840
Test: presubmits
Change-Id: I79365e2a3608c8eaeba954b7c193775e98fb2a91
2021-04-15 11:12:57 -07:00
Treehugger Robot
9864e155a8 Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/base" am: 7226ad3729 am: a087245e03 am: 3dd40d172b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661581

Change-Id: I99cb5fd94c4ee02688709ad00e3ffbc3e2f388e7
2021-04-01 13:47:07 +00:00
Treehugger Robot
3dd40d172b Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/base" am: 7226ad3729 am: a087245e03
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1661581

Change-Id: I70994b32bd4a68bb3d3062d349cc833ba2edf5a0
2021-04-01 13:02:13 +00:00
Bob Badour
de423b7a58 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  drm/java/Android.bp
  graphics/java/Android.bp
  identity/Android.bp
  identity/java/Android.bp
  keystore/java/Android.bp
  location/java/Android.bp
  location/tests/Android.bp
  lowpan/java/Android.bp
  media/mca/effect/java/Android.bp
  media/mca/filterfw/java/Android.bp
  media/mca/filterpacks/java/Android.bp
  mime/java/Android.bp
  mms/java/Android.bp
  opengl/java/Android.bp
  rs/java/Android.bp
  sax/java/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  telecomm/java/Android.bp
  telephony/common/Android.bp
  tests/FlickerTests/test-apps/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  telephony/java/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I2ee0af9ce8f74de2172b359b41d2c52a8b8f7e6c
2021-03-31 19:55:25 -07:00
Anton Hansson
5013902a24 Merge changes I97086e30,Ic55df4cf,I81a08c29 am: 4199ef90b9 am: 4bc578052d am: ec1f981309
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655736

Change-Id: I5d242cf5b18c4b556105cfcfe78df2ac18a8544e
2021-03-31 18:01:32 +00:00
Anton Hansson
ec1f981309 Merge changes I97086e30,Ic55df4cf,I81a08c29 am: 4199ef90b9 am: 4bc578052d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655736

Change-Id: Ib8d66e1fb8845f3b47fd6e81091c0286ca6c8c9c
2021-03-31 17:32:14 +00:00
Anton Hansson
9b2c4a650b Move framework java filegroups into subdirectories
All the java code used to build the framework jar and run metalava
was previously defined in the toplevel Android.bp files. Move these
into the subdirs where the source actually lives.

This simplifies the rules themselves (no path and needless prefix) and
declutters the top level Android.bp.

Test: m
Change-Id: I97086e309eacb879d16facb8497d9940fa5ddaf6
2021-03-30 12:26:55 +01:00
Shinru Han
c247fad24e Merge "Add docs to SatellitePvt class" into sc-dev 2021-03-26 09:59:31 +00:00
Soonil Nagarkar
2b8a31a838 Merge "Remove dynamic location settings footer" into sc-dev 2021-03-25 21:08:32 +00:00
Shinru Han
25474af18c Add docs to SatellitePvt class
Bug: 183670215
Test: comment only
Change-Id: Ie9cef6f22d8a9b020ce081ca18e02f43eb259188
2021-03-25 14:46:52 +08:00
Soonil Nagarkar
1f731d7bb1 Merge "Make Location.setMock() public" into sc-dev 2021-03-25 01:19:47 +00:00
Soonil Nagarkar
ed28be3633 Make Location.setMock() public
Also renames *FromMockProvider to *Mock for clarity.

Bug: 183632564
Test: atest CtsLocationFineTestCases
Change-Id: Ic3b2cc2ec69d6a632e347868e7cc53e56e7400b0
2021-03-24 12:26:00 -07:00
Shinru Han
2bd6304749 Add capability bit for Bluesky driving
Bug: 182304682
Test: on cuttlefish
Change-Id: Ic4655c5002712f7872c5a090986da5565ab63278
2021-03-24 11:17:32 +08:00
Soonil Nagarkar
c257baefb5 Refactor ServiceWatcher
Split it up into more generic and useable components that are not as
location specific.

Bug: 182491144
Bug: 181665909
Test: presubmits
Change-Id: I2d6d5e70328657a7430e170531402cb3acbed028
2021-03-22 20:27:31 -07:00
Soonil Nagarkar
1dc7b05ca3 Fix logging bugs
Adds additional logging around user switches, and fixes a bug where
location toggle changes were not logged correctly.

Bug: 183409327
Test: manual
Change-Id: I36fdef5c3eddd3db70d7c18506f82bb687677120
2021-03-22 15:00:51 -07:00
Yu-Han Yang
1bdbcffaa1 Merge "Update Javadoc of getData() for IRNSS" into sc-dev 2021-03-17 17:47:47 +00:00
Shinru Han
473ebd77d5 Add comment for getMagnitude in CorrelationVector
Bug: 179389247
Test: comment only
Change-Id: I826e7a34940267a32e37ed57074e17c0c17b1515
2021-03-17 11:32:06 +08:00
Yu-Han Yang
67738c9a38 Update Javadoc of getData() for IRNSS
Bug: 182848571
Test: javadoc only
Change-Id: Ia72f8c4cb2bd78ea4b399d3d4bfff6107fa3875b
2021-03-15 18:40:26 -07:00
Soonil Nagarkar
a157bb3399 Remove dynamic location settings footer
Replace with plain text.

Bug: 182210346
Test: manual
Change-Id: Iaf14044e08ca8f4e09f38a96bbe4d2c66a100b13
2021-03-08 15:23:40 -08:00
TreeHugger Robot
2d98e149eb Merge "Fix the return type of getFrequencyOffsetMetersPerSecond" into sc-dev 2021-03-08 18:10:51 +00:00
TreeHugger Robot
485249abd1 Merge "Clean up dead code in NetInitiatedActivity" into rvc-qpr-dev am: 91568eb50e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13288128

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7ebe7a1a4da45b4e238de50aa21691afffa30203
2021-03-05 17:18:59 +00:00
Soonil Nagarkar
be0734de31 Merge "Assorted minor cleanups" into sc-dev 2021-02-27 01:14:41 +00:00
Soonil Nagarkar
f4c020d185 Use listener for AntennaInfo
Replace broadcast with listeners in response to API feedback.

Bug: 178714745
Test: atest CtsLocationFineTestCases
Change-Id: Ibb52b167c916fa6b5a9238371ba26b86801389d2
2021-02-26 09:03:28 -08:00
Soonil Nagarkar
76c7af7ae8 Assorted minor cleanups
Make tag list nonnull, and rename to extraAttributionTags, and add shell
command support for adding location provider with extra attribution
tags.

Bug: 181254689
Test: presubmits
Change-Id: I52e55094c7043d0e75f902a4177f15e27b018de5
2021-02-25 13:04:31 -08:00
Shinru Han
fa613735c4 Fix the return type of getFrequencyOffsetMetersPerSecond
CorrelationVector#getFrequencyOffestMetersPerSecond() should return double.

Bug:179389247
Test: on cuttlefish

Change-Id: I0a999915a0dccb06abb65af68105abd862c14708
2021-02-25 13:34:17 +00:00
Svet Ganov
4700428b6f Location provider app ops remapping
The platform has the concept of a location provider which could
be a plugin implemented by another package. The implementation
of a location provider plugin can make calls to APIs that require
a location permission, e.g. fusing data from different sources.
However, such accesses are counted in app ops as a location access
but the accessor is in this case the data source. It is also
possible that the package that provides the implementation of a
location provider also hosts other funcionality which may need to
call APIs that require a location permission.

This change allows a location provider to specify app op attribution
tags which which could be used when calling location to singal to the
OS that the access is for the location providing functionality of the
location provider. For location accesses of the provider package that
are not related to providing location to the OS the provider can use
any other non delcared as location attribution tags. Accesses with
the location attribution tags would be counted in app ops but instead
of towards the OP_COARSE_LOCATION/OP_FINE_LOCATION the would be
counted towards dedicated OP_COARSE_LOCATION_PROVIDER/
OP_FINE_LOCATION_PROVIDER ops. This would allow proper classification
while enabling auditability and tracking via the standard app op APIs.

<meta-data
    android:name="android:location_allow_listed_tags"
    android:value="foo;bar;baz"/>

Test: atest android.location.cts.fine.LocationManagerFineTest#testLocationAttributionTagBlaming

Bug:179062648

Change-Id: I36739ab42cedc94e1aa7a3bfd3b9aa213f5b3e97
2021-02-24 23:11:35 +00:00
Soonil Nagarkar
2e0c80b260 Merge "Use full identity instead of package in historical stats" into sc-dev 2021-02-24 19:48:53 +00:00
TreeHugger Robot
39ceb7f367 Merge "Rename to addProviderRequestListener (framework/base)" into sc-dev 2021-02-24 05:03:22 +00:00
Soonil Nagarkar
1ec47e9ce0 Use full identity instead of package in historical stats
This will allow us to better distinguish between clients in our
historical data.

Bug: 180857151
Test: presubmits
Change-Id: Idd0123ca15f54f8380107c9cc0b6f24474532b3d
2021-02-23 15:17:27 -08:00
TreeHugger Robot
b571954216 Merge "Add listenerId information to GNSS APIs" into sc-dev 2021-02-23 22:44:53 +00:00
Yu-Han Yang
b69bfcc2af Rename to addProviderRequestListener (framework/base)
Bug: 180733549
Test: on device
Change-Id: I2d303626ccd9a5c4d68dc4c94ed85df3002c3fed
2021-02-23 09:43:25 -08:00
TreeHugger Robot
d2191dbad6 Merge "Further reduce LM memory cost" into sc-dev 2021-02-22 21:29:42 +00:00
Soonil Nagarkar
486dd29332 Add listenerId information to GNSS APIs
Bug: 180935385
Test: presubmits
Change-Id: Ic9534422d9de059e98dfc52292c57188f9aaffa9
2021-02-22 13:13:34 -08:00
TreeHugger Robot
5611e4d88b Merge "Update javadoc for carrierFrequency and AGC" into sc-dev 2021-02-22 20:07:23 +00:00
Soonil Nagarkar
9627429fae Implement stationary location throttling
Throttle location providers completely when the device is completely
still, and provide "faked" locations instead.

Bug: 172688700
Test: manual + atest StationaryThrottlingLocationProviderTest
Change-Id: Iba4e50ebf78cd8c6a9f2433ecb6e967d3a533c63
2021-02-12 11:45:08 -08:00
Yu-Han Yang
0940129f60 Update javadoc for carrierFrequency and AGC
Since Android S, carrier frequencies in GnssStatus and GnssMeasurement are
required. Also added a comment to clarify AGC value.

Bug: 179157665
Bug: 173523109
Test: comment only
Change-Id: I1f59bcc0c26739a2057037da766cd0a5206e06ff
2021-02-11 15:19:40 -08:00
Soonil Nagarkar
f655448523 Further reduce LM memory cost
Reduce number of generated synthetic accessors for private var/methods,
put ProviderRequest listener into lazily loaded class, and switch to
ArrayMap instead of WeakHashMap when server-side transport removal is
not a consideration. Also adds support for replacing an old transport
in a single remote call, rather than two remote calls.

Bug: 13463193
Test: none
Change-Id: I09dab317dc82aeda51422af1047274631081c3e1
2021-02-10 12:59:19 -08:00
Yu-Han Yang
72a2512267 Add LocationManager#registerProviderRequestListener
Bug: 179389815
Test: atest LocationProviderManagerTest#testProviderRequestListener
      atest LocationManagerFineTest#testRegisterProviderRequestListener
Change-Id: I051df7a529b8a5a2b0709231a0a5f1bd3792125d
2021-02-08 10:01:54 -08:00
TreeHugger Robot
df079b7943 Merge "Update batching APIs" into sc-dev 2021-02-04 19:47:40 +00:00
TreeHugger Robot
cb97515c4f Merge "Update deprecation docs with more info" into sc-dev 2021-02-04 19:21:34 +00:00
TreeHugger Robot
4c7e9d1a90 Merge "Reduce LocationManager memory usage" into sc-dev 2021-02-04 19:13:26 +00:00
Adrian Roos
d68bee2746 API: Suppress existing NullableCollections lints am: 6a6aa5e23d am: 4da67dd2f6 am: 98eb82a6d3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1566096

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I314b97d2677f26b0a9c09a52918df49096450aea
2021-02-04 17:09:38 +00:00
Soonil Nagarkar
541499a772 Update deprecation docs with more info
Add additional javadoc around LocationProvider deprecation.

Bug: 178651398
Test: na
Change-Id: I601fccaf897400667a4dc4f9a9d1af5150a234a1
2021-02-04 08:30:38 -08:00
Soonil Nagarkar
e97179d846 Update batching APIs
After API council feedback, use List<Location> in public APIs rather
than LocationResult.

Bug: 173712888
Test: atest CtsLocationFineTestCases
Change-Id: I02caa1f9c7164b52ef55c71ca14fb2bd7e311a85
2021-02-03 17:02:14 -08:00
Soonil Nagarkar
204b133883 Reduce LocationManager memory usage
Move GNSS listener overhead into statics so it's shared per process, and
do not instantiate by default.

Previously GNSS requests were multiplexed by LocationManager instance,
this is now removed. This could mean additional binder overhead, but
it's pretty unlikely that this feature was in active use anywhere, as in
any large application that has multiple gnss requests, they are usually
coming from different contexts (and thus LocationManager instances) and
would not have seen the benefit of multiplexing anyways.

Bug: 179261871
Test: atest CtsLocationFineTestCases
Change-Id: I8b7a41c13dfe219c326b1e519483d89d2b721ce5
2021-02-03 17:08:16 +00:00