1050 Commits

Author SHA1 Message Date
TreeHugger Robot
209f3ff1f0 Merge "Clean up dead code in NetInitiatedActivity" 2021-01-05 21:49:17 +00:00
Neil Fuller
204b52a384 Delete location.timezone.provider API classes
Delete location.timezone.provider API classes and associated internal
classes that are no longer used.

Bug: 175633818
Test: build
Change-Id: I66319e63e3150e3b71f31f8d9404e4114f802662
2021-01-05 20:36:29 +00:00
Soonil Nagarkar
a51e4d761f Add permissions javadoc
Bug: 171512333
Test: none
Change-Id: I6b7159dec4ddc69c944616ea17e99d328f2f2db5
2021-01-05 10:20:27 -08:00
Yu-Han Yang
b5765cc3e7 Clean up dead code in NetInitiatedActivity
Bug: 174151048
Test: on device
Change-Id: I5a3a77557720571b455ffec296cdd4e2e1a02f7b
2020-12-29 10:42:33 -08:00
Soonil Nagarkar
b76a3541a1 Replace LocationProvider with ProviderProperties
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-28 10:50:50 -08:00
Yu-Han Yang
3b6a51e4ce Expose enableFullTracking API to public
Changes include
- Rename GnssRequest to GnssMeasurementRequest
- Remove LOCATION_HARDWARE permission check for fullTracking mode

Bug: 175631328
Bug: 162977669
Test: on device
Change-Id: I253318fe0a6f92523de7564cd9086e8d96c2393b
2020-12-17 10:15:57 -08:00
TreeHugger Robot
8068b16f2f Merge "Move NUM_GPS_SIGNAL_QUALITY_LEVELS to GnssSignalQuality" 2020-12-16 18:58:25 +00:00
Soonil Nagarkar
ff097cef17 Move NUM_GPS_SIGNAL_QUALITY_LEVELS to GnssSignalQuality
This allows us to move GnssMetrics out of the client in a follow up CL.

Test: compiles
Change-Id: Idce044199f2ce223f893bfaecf43e5043a83bb94
2020-12-15 21:29:08 +00:00
Soonil Nagarkar
018a3adbd5 Merge "Restore get/setExtras per API council feedback" 2020-12-11 20:57:15 +00:00
Soonil Nagarkar
f0465425c8 Merge "Location OWNERS updates" am: 2e8693718c am: c02e647603 am: c568376083
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1522299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic48a74d51cf700cf8c737c27cd8f94b6ac25d404
2020-12-11 18:34:25 +00:00
TreeHugger Robot
d4c2928f8f Merge "Make FUSED_PROVIDER public API" 2020-12-11 17:21:44 +00:00
Soonil Nagarkar
2e8693718c Merge "Location OWNERS updates" 2020-12-11 17:12:03 +00:00
Soonil Nagarkar
b1ad3c5625 Restore get/setExtras per API council feedback
These methods are still valuable enough they shouldn't be deprecated.

Bug: 173712888
Test: none
Change-Id: I47b46e0db95c0fb29c2a73fb5355d9f9ce21c6df
2020-12-11 09:05:33 -08:00
Soonil Nagarkar
51c43292b6 Location OWNERS updates
Change-Id: I0c3debf00a28d4ca930582fb23bd34159ef1ddd4
2020-12-09 14:28:28 -08:00
Soonil Nagarkar
34c8c17451 Make FUSED_PROVIDER public API
Expose the fused provider publicly, and change API results to reflect
this.

Bug: 174580458
Test: none
Change-Id: I61956fbe2b15d1c0c19f6ca2b6ff435146625e9f
2020-12-09 12:01:15 -08:00
Wei Wang
5675ee40c3 Nullable annoation for Location#setExtras.
Bug: 175073579
Test: it complies.
Change-Id: I43b57289bb47703c1e2486de57dbf5642eae8d89
2020-12-09 01:39:07 -08:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
9af6ac78b0 Merge changes from topic "dec5" am: c2793cf12b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519384

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifdc390f5ae046c515a30158f3f55b831be147547
2020-12-08 16:05:11 +00:00
Jeff Sharkey
c7c4a74a78 Improve OWNERS coverage across frameworks/base/. am: fab0ab3c9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519383

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I0211462ecbcd9ad66f66af87e31cf12e1582fc65
2020-12-08 16:01:16 +00:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
2020-12-08 08:36:27 -07:00
TreeHugger Robot
4103bfdf2e Merge "Adds LastLocationRequest SystemApi" 2020-12-07 18:22:20 +00:00
TreeHugger Robot
e1af0f920f Merge "Clarifying documentation on removeUpdates and flushing" 2020-12-04 21:26:41 +00:00
Soonil Nagarkar
7d6333e824 Clarifying documentation on removeUpdates and flushing
Document how batch flushes interact with removing updates.

Test: n/a
Change-Id: Ie65f517a7bda6273739f9c59df18e290fd0d770a
2020-12-04 09:21:54 -08:00
Soonil Nagarkar
ffc0b6e79a Adds LastLocationRequest SystemApi
Creates a new LastLocationRequest object similar to LocationRequest,
specifically for useage with the getLastLocation() APIs. This allows
SystemApi clients to pass in important parameters like
locationSettingsIgnored, etc...

Bug: 173666111
Test: manual + presubmits
Change-Id: I2e0253e5275d9d17cfb5a9243de0ef12ab33348c
2020-12-03 11:20:10 -08:00
Xin Li
d31ee38811 Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855
Bug: 172690556
Merged-In: I78222391b83a4add8e964340ec08bb8a1306e1c6
Change-Id: I28bbf40820674675ccf765c912aa8140d3f74ab2
2020-12-02 00:38:58 -08:00
Neil Fuller
110409d776 Change LocationTimeZoneEvent elapsed realtime
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-25 10:41:11 +00:00
Neil Fuller
ecadc4195d Merge "Move LocationTimeZoneEvent to com.android" 2020-11-24 18:01:24 +00:00
Neil Fuller
bd14141056 Move LocationTimeZoneEvent to com.android
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-24 14:47:16 +00:00
Soonil Nagarkar
0d108d8f4c Normalize user active logic across Location APIs
Adds additional logic for location requests coming from the system
server, such that those requests may allowed so long as location is on
for the current user, even if the system user has location disabled.
Even though the system server runs under the system user, it may need
to service requests from or on behalf of other users.

Test: presubmits + manual
Change-Id: Ic9d7762e75fc930b7d26f1d1bf20b272d562939c
2020-11-20 23:21:51 +00:00
Soonil Nagarkar
11a0b63bb4 Make FUSED_PROVIDER SystemApi
This should always have been SystemApi, as most fused providers are
implemented outside system server. There is a strong argument this
should actually be public API, but I'm punting on that for now until we
can give it more consideration.

Bug: 173030969
Test: none
Change-Id: If5ba10accbe2f6ce47d749536d053e1bd8e297f8
2020-11-11 11:16:53 -08:00
Soonil Nagarkar
bf126a7af3 Merge "Add batching APIs and Location.equals()" 2020-11-10 23:33:35 +00:00
Yu-Han Yang
5f084f88db Merge "GNSS Satellite Blocklist Renaming" 2020-11-10 23:06:24 +00:00
Soonil Nagarkar
be6ed5aa14 Add batching APIs and Location.equals()
-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-11-10 10:14:34 -08:00
Neil Fuller
ca04b8dd17 Merge "Remove use of UserHandle in LocationTimeZoneEvent" 2020-11-06 09:50:02 +00:00
Neil Fuller
95600ac273 Remove use of UserHandle in LocationTimeZoneEvent
It causes problems with permissions in testing and isn't strictly
required so it can be removed.

Bug: 152744911
Bug: 149014708
Test: atest services/tests/servicestests/src/android/location/timezone/LocationTimeZoneEventTest.java
Change-Id: Iba9c07780e3cc9f94f2c77144c48916236f31e60
2020-11-05 19:56:26 +00:00
TreeHugger Robot
53fee0433c Merge "Fix security hole in Geocoder APIs" 2020-11-05 03:35:08 +00:00
Soonil Nagarkar
de38982c30 Fix security hole in Geocoder APIs
Geocoder APIs are a mess, but this will at least validate the caller
properly, and pass the relevant information along to clients.

Bug: 158318462
Test: presubmits
Change-Id: I47b09962598a2346bd79caa643ba1d83069c0c19
2020-11-04 14:55:07 -08:00
Soonil Nagarkar
0875bf8c70 Block immutable PIs from location APIs
Bug: 171317480
Test: atest CtsLocationFineTestCases
Change-Id: Ifba03b853f0681a5949d89c4a8e7c2de9a5c6018
2020-11-04 08:58:18 -08:00
Mathew Inwood
5d123b6775 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Yu-Han Yang
8318aba8ed GNSS Satellite Blocklist Renaming
Test: on device
Bug: 168111993
Change-Id: I2ee4414fbc1fcb7abe8a3d5b1099a3e6e58a6777
2020-11-02 17:47:59 -08:00
Sasha Kuznetsov
65186049b1 Merge "Clarifiy ADR states in documentation" 2020-10-29 17:10:51 +00:00
Mathew Inwood
8e742f928e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Sasha Kuznetsov
405047318b Clarifiy ADR states in documentation
Bug: 167930284
Test: n/a

Change-Id: I34b7d61bcff7e43861d66c6a3cda5a77ec66ee4c
2020-10-28 17:21:47 -07:00
Hongwei Wang
050275cd83 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
72f07d6a8a Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
TreeHugger Robot
8a531bb4af Merge "Make ListenerMultiplexer more flexible" 2020-10-27 00:13:04 +00:00
Soonil Nagarkar
3a983cb95f Make ListenerMultiplexer more flexible
Previously ListenerMultiplexer attempted to be perscriptive about when
individual listener invocations should be allowed, but this is not
proving flexible enough. So, we allow registrations to invoke listeners
at any time without being perscriptive about it instead.

Test: manual + presubmit
Change-Id: I6ff8c6bd4f3e3af15d6ebc4b484b971df5a8c0e2
2020-10-26 13:40:00 -07:00
Jeff Sharkey
1992cdb4de Merge changes from topic "oct16c"
* changes:
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStrings.
  Apply fixes for EfficientStringsChecker.
  Apply fixes for EfficientCollections.
  Trivial refactor for consistent naming.
  Expand formatSimple() to support widths.
  Refinement of EfficientStringsChecker.
2020-10-21 15:27:15 +00:00
Jeff Sharkey
1c08f48253 Apply fixes for EfficientStringsChecker.
The recently-built Error Prone checker has found many instances where
we're always paying the cost of StringBuilder concatenation, even in
the typical cases where preconditions are successfully met.

Benchmarks have shown that even when replacing these with varargs
formatter strings, the default case is 20x faster.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If8c00bc73467bfb91ec16c162969c9d26ca53646
2020-10-20 22:00:16 -06:00