Commit Graph

2761 Commits

Author SHA1 Message Date
Tobias Thierer
c20c2ea28e Revert "Track updates to Conscrypt". DO NOT MERGE ANYWHERE.
Tracks the revert of the corresponding conscrypt CL.

This reverts commit 7fdce769c3.

This is a clean revert. The upload hook to fix lint errors was not run
(this CL was uploaded with --no-verify).

Test: Treehugger
Test: make droid cts
Bug: 62424503

Change-Id: I5b8728575c4c02de10fff227ba40ec6ddc7ffa46
2017-06-26 20:38:15 +01:00
Hugo Benichi
9c2acc1760 Better errors from unregisterNetworkCallback
This patch changes the validation of unregisterNetworkCallback in
ConnectivityManager so that the caller can better distinguish the case
of a callback that was never registered from the case of a callback that
has already been unregistered.

Bug: 62497809
Test: runtest frameworks-net passes
Merged-In: I58eda22725dd4e67dc4b64207e38cf482032df10

(cherry picked from commit 605b295011)

Change-Id: I4d2be5d9037cfec03218b702d707f50808ee0694
2017-06-20 10:06:44 +09:00
Sundeep Ghuman
216f596cee Merge "Remove Wifi Badges from platform." into oc-dev
am: 09d06437ad

Change-Id: Ie5150009258a7bccfdf222bf21329722e1e20589
2017-06-07 23:25:50 +00:00
Sundeep Ghuman
19f64d084d Remove Wifi Badges from platform.
This change makes it impossible to return a badged wifi icon, even if
scoring ui is enabled. It also prevents IAE from net badgecurve enums.

Bug: b/35628911
Test: make -j40
Change-Id: I014f27e5c4e42075e7e62da7fffb9ecf38f6eb4c
2017-06-06 17:40:01 -07:00
Robert Quattlebaum
557e0c38b9 NetworkCapabilities: Added support for TRANSPORT_LOWPAN
This change simply adds a new constant, `TRANSPORT_LOWPAN`, for
identifying low-power wireless networks like Thread.

Bug: b/33073713
Change-Id: Ie4aa77496f8ff466fa1a5fbc556e9c029457a689
2017-06-06 18:38:31 +00:00
Jeff Sharkey
ec68b46bc8 Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 7a2e4a8486

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
7a2e4a8486 Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
d86b8fea43 Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
nharold
a5cf046ca9 Merge "Add UDP Encap Socket Support to IpSecManager" am: 4f6ec3d11d am: c530c01744 am: 3c1484c715
am: 7577a2ff56

Change-Id: Iafed2773a6d32542b051d944341533b2190aa284
2017-06-03 00:15:53 +00:00
nharold
7577a2ff56 Merge "Add UDP Encap Socket Support to IpSecManager" am: 4f6ec3d11d am: c530c01744
am: 3c1484c715

Change-Id: Idc082c1ab2aac63ad61e5fc74be7fa75cf6e686f
2017-06-03 00:04:41 +00:00
Nathan Harold
8dc1fd0237 Add UDP Encap Socket Support to IpSecManager
-Implement the UdpEncapsulationSocket
-Convert all ManagedResources to use resourceIds
-Rework ManagedResource to track resourceIds

Bug: 30984788
Test: cts - IpSecManagerTest#testUdpEncapsulation()

Change-Id: I7b1099c487051a8d951c1485791c4b6cef2deb1d
2017-06-02 03:18:56 +00:00
Hugo Benichi
66fde44b14 Merge "NsdServiceInfo: move test to tests/net" am: 48859e01d5 am: 1b0f4bf606 am: e8c2700519
am: 41687a201b

Change-Id: I11af75ab8ebc4081cc90d29b83d8a1742f00a3ab
2017-05-25 01:18:45 +00:00
Hugo Benichi
41687a201b Merge "NsdServiceInfo: move test to tests/net" am: 48859e01d5 am: 1b0f4bf606
am: e8c2700519

Change-Id: I44cae417fcddad72c13938b6fb751de6ed784046
2017-05-25 01:12:51 +00:00
Hugo Benichi
e7514335bf NsdServiceInfo: move test to tests/net
This patch also
  - adds a license plate to NsdServiceInfoTest
  - fixes some formatting and style issues
      package name
      uses of canonical junit asserts
  - update NsdServiceInfoTest to not use the deprecated AndroidTestCase

Bug: 62044295
Bug: 32561414
Test: $ runtest frameworks-net passes
Change-Id: Ie5ebb00172aef4eec19e6ecd2b41c4467901b93d
2017-05-24 16:03:43 +09:00
Hugo Benichi
674f32697a Merge "ConnectivityManager: simplify callback handler" am: 857e7d9c85 am: 7bce658dd6 am: a67fb638fa
am: a0dff338c0

Change-Id: I8d2373bfd1ae3fabab8f556d2b8c8cfa6310818c
2017-05-23 06:43:16 +00:00
Hugo Benichi
a0dff338c0 Merge "ConnectivityManager: simplify callback handler" am: 857e7d9c85 am: 7bce658dd6
am: a67fb638fa

Change-Id: I3934666df4a02101351993f7f83fb0a42124a2f5
2017-05-23 06:37:24 +00:00
Hugo Benichi
835a61c846 Merge "NsdService: test coverage for client requests." 2017-05-23 05:54:07 +00:00
Hugo Benichi
6bb59fc82d NsdService: test coverage for client requests.
Adding coverage for:
  - NsdManager client disconnection
  - in-flight request GC

Test: new test passes
Bug: 37013369, 33298084
Bug: 38503832

(cherry picked from commit ab5bdbf84e)

Change-Id: I02aca772d88306acae09db739ced7a2b1119b72b
2017-05-23 12:53:55 +09:00
Hugo Benichi
c64f438d47 Merge "Merge "ConnectivityManager: improve argument validation" am: cdfd3a186f am: 0187514f74 am: b800e8520e" into oc-dev-plus-aosp
am: dd06c9461b

Change-Id: I2a9ba4202ffca20fa4931680f9e3bf4313dcfb6f
2017-05-23 03:52:00 +00:00
Hugo Benichi
b7af1503a1 Merge "ConnectivityManager: improve argument validation" am: cdfd3a186f am: 0187514f74
am: b800e8520e

Change-Id: Idfc0938025c633c89f5bfddd88b3721876d085ef
2017-05-23 03:41:52 +00:00
Hugo Benichi
2c68452320 ConnectivityManager: simplify callback handler
Bug: 36701874
Test: $ runtest frameworks-net
Change-Id: I4d5f08903a54f8dced7cb6ae86703847b908b784
2017-05-23 10:39:46 +09:00
Hugo Benichi
e7678517b3 ConnectivityManager: improve argument validation
Using Preconditions and dedicated static methods for checking arguments
to improve error stack traces without error messages.

Test: covered by previously added unit test
Bug: 36701874
Change-Id: Id872b2c887a4bca43a8c3644622add1c2ee57c6d
2017-05-23 10:39:45 +09:00
Hugo Benichi
275c1ac91c Merge "Address ConnectivityManager API comments." am: b5d6e45e8d am: b57db6ef97
am: 08ab9ea526

Change-Id: I8e5e44043bb7efde3e21650e7edf3f121aff1e6e
2017-05-19 23:36:09 +00:00
Hugo Benichi
b5d6e45e8d Merge "Address ConnectivityManager API comments." 2017-05-19 23:05:57 +00:00
Lorenzo Colitti
2965d33afc Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: Ide82858af67024623560ab79beea27c201b63447
Merged-In: I82a9a9a8da47870ba3f1bbef5941b37e970c844f

(cherry picked from commit 4734cdbbc3)
2017-05-19 00:58:41 +00:00
Christopher Tate
3bf017325c Be resilient to restoring unintelligible network templates
Some OEMs have introduced incompatible network bookkeeping.  We now
detect and ignore those network definitions at restore time.

In addition, we now

  * log when an undefined network match type is used to construct a
    NetworkTemplate instance, and
  * quietly refuse to match such a NetworkTemplate against any known
    network identifier, rather than crashing the inquiring app.

Bug 38151335
Test: manual

Change-Id: I565b6f6b87df1f13a8c0c01ae6049bda270b1e48
2017-05-17 10:33:01 -07:00
Hugo Benichi
0eec03f75c Address ConnectivityManager API comments.
This patch is a cherry pick of the two following commits:
  - 15fd4395e1 which addresses several
    issues in the public api of ConnectivityManager.
  - e2d48ff57c which fixes the documentation
    of several methods in ConnectivityManager public api.

Because the first commit change the public api that is referenced in
the documentation fixed by the second commit, it is not possible to one
without the other. In both cases trying to cherry pick only one of them
results in a build error.

The first commit was submitted successfully on an internal branch before
the checks done in the built got stricter.

Bug: 36370941
Test: marlin builds and boots
Change-Id: I86dcf056e6b165e527c3ee88dbabc2764ac09a08
Merged-In: I693ee5270bf186c88c7c5056293519f7237504ff

(cherry picked from commit 15fd4395e1)
2017-05-17 21:48:05 +09:00
Jeremy Joslin
957bdf0e61 Merge "Remove deprecated recommendation request code." into oc-dev am: b2bd32929b
am: 964cddccda

Change-Id: I0f30175b3be0d6a66fccd736ec5962f893cb2d9e
2017-05-16 19:23:52 +00:00
Jeremy Joslin
964cddccda Merge "Remove deprecated recommendation request code." into oc-dev
am: b2bd32929b

Change-Id: I0efb561f7829598eb5a509474e1a6e54e00bb93d
2017-05-16 19:02:40 +00:00
TreeHugger Robot
76700b56ec Merge "ConnectivityManager: fix documentation" 2017-05-16 14:31:28 +00:00
Hugo Benichi
bd4317f754 Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207 am: e13c192d0f
am: 36d913c7b9

Change-Id: I455d9712ad7f60f7474077435ff977c95b3b48c3
2017-05-16 13:34:37 +00:00
Hugo Benichi
36d913c7b9 Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207
am: e13c192d0f

Change-Id: Ib8368c5a8538914cba2723368c03618401ac159f
2017-05-16 13:25:09 +00:00
Hugo Benichi
d5ad3e8a0c Remove unused import in ConnectivityManager
This makes the pre-upload verification pass.

Test: no functional change.
Change-Id: I6beccea10ccfcb39d975cb8f6f34fc9d79f1e170
2017-05-16 11:39:08 +09:00
Hugo Benichi
e2d48ff57c ConnectivityManager: fix documentation
Documentation pointing to the registerNetwork() overload including a
timeout argument was pointing to the version removed by commit
15fd4395e1. This makes it impossible to
cherry pick 15fd4395e1 due to the linter
complaining about unresolvable links.

This patch fixes the documentation to point to the registerNetwork()
with argument types NetworkRequest, NetworkCallback, int, in that order.

Bug: 36370941
Test: no functional change
Change-Id: Ieaf58f81d89fdf63f480fd15e65ed52822fc4f51
2017-05-16 11:36:24 +09:00
Jeremy Joslin
9407a9490b Remove deprecated recommendation request code.
Removed all deprecated code related to network recommendation
requests.

Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: runtest frameworks-services -c com.android.server.NetworkScorerAppManagerTest
Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t com.google.android.gts.netrec.NetRecHostTest
Bug: 37357264
Change-Id: I81bb6ff6236b249b8e14058c1bfdb938451a75b0
2017-05-11 15:43:57 +00:00
Hugo Benichi
36af98c6ba Merge "Merge changes Ie762ce75,I611fd791 am: 21a57f263f am: cc9f695ba0 am: 164854bde2" into oc-dev-plus-aosp
am: b09b85471c

Change-Id: I8b1b20d81efa2d86345b3b15600bed4cd40bb6e8
2017-05-11 14:52:23 +00:00
Hugo Benichi
3ec835303c Merge changes Ie762ce75,I611fd791 am: 21a57f263f am: cc9f695ba0
am: 164854bde2

Change-Id: I1495249f1ced84438dbd5dd0ad6678e2ee4062cb
2017-05-11 14:28:23 +00:00
Hugo Benichi
cb88323dd2 ConnectivityManager: uses service error codes and exceptions
This patch introduces between ConnectivityManager and
ConnectivityService a mechanism for propagating back to clients
informative errors in the form of error codes and associated custom
runtime exceptions.

Without error code, the service can only throw a limited number of
different exceptions over Binder. Furthermore the throw site stack
traces are always loss. Although for individual instances of a throw,
the error message can be inspected, aggregations of stack traces from
app crashes sanitize error messages and only leaves the stack traces.

This makes debugging dificult for some service calls such as
requestNetwork that can have a variety of failure modes.

In this patch only one failure mode is codified. More can be added later
at a light cost by: 1) defining an error code, 2) defining an
associated exception, 3) mapping the code to the exception. This patch
can serves as a template for doing so.

Test: $ runtest frameworks-net,
      #testNetworkRequestMaximum() detects the new exception type.
Bug:  36556809, 36701874
Change-Id: I611fd7915575c9e418f7149fcdc8a879d2a3716d
2017-05-11 14:15:15 +09:00
Hugo Benichi
515a54c4b8 Merge changes I4872f8ba,I92039f29,Iaad13e13 am: 767ac317e2 am: 717238a614
am: 44e9b81c54

Change-Id: I9c38d1254f82b50f4d1e953e72bf15a46562d3b8
2017-05-09 06:30:48 +00:00
Hugo Benichi
ab5bdbf84e NsdService: test coverage for client requests.
Adding coverage for:
  - NsdManager client disconnection
  - in-flight request GC

Test: new test passes
Bug: 37013369, 33298084
Change-Id: I92039f297cf99352bbf4196797933d89c0b819ff
2017-05-09 10:49:33 +09:00
Hugo Benichi
ff3e6ccca1 NsdManager: remove duplicated argument validation
This patch simplifies argument validation in NsdManager public api and
regroup duplicated validation into common methods.

This makes stack traces more actionable as now specific errors will
cause the api to throw exception from specific methods, whereas before
IllegalArgumentException would be thrown from inside the same api method
for different reasons.

This patch also includes a couple of other small cleanups.

Test: $ runtest -x frameworks/base/tests/net/../NsdManagerTest.java
Bug: 37013369
Change-Id: Iaad13e13976e9bf8f508d7188f823f8184ac414b
2017-05-09 10:49:33 +09:00
Kenny Root
7df412a6bf Track updates to Conscrypt am: 7fdce769c3 am: 0634c4f77f
am: 4fd0b06ac7

Change-Id: I39c4532965db9a154657e7f90ff6a5b1ebb84a35
2017-05-05 21:32:28 +00:00
Kenny Root
0634c4f77f Track updates to Conscrypt
am: 7fdce769c3

Change-Id: I691f1ed588814311363f67b8ce43cbe247e54b71
2017-05-05 21:08:48 +00:00
Kenny Root
c497348c74 Merge changes from topic 'update-conscrypt'
* changes:
  Delete obsolete and unused KeyStoreTests
  Track updates to Conscrypt
2017-05-05 21:00:40 +00:00
Jeremy Joslin
8cc43b6fa7 Merge changes from topic 'allow_none_scorer' into oc-dev
am: d05dda1d40

Change-Id: I90864d95416167384c7acb9ac3d6beb8e523b682
2017-05-03 23:05:51 +00:00
Jeremy Joslin
a9f933e53a Revert permission check on setActiveScorer.
Reverted to the pre-O behavior of allowing the call if the caller
has the SCORE_NETWORKS permission.

Test: runtest frameworks-services -c com.android.server.NetworkScoreServiceTest
Bug: 37722313
Change-Id: I54a99dde364d6a5c88d35072922020542c6ae003
2017-05-02 12:23:05 -07:00
Hugo Benichi
807c525de2 Merge "NsdManager: add test coverage for discoverServices()" am: 3e21b1745c am: 60182dbe4e
am: 27b0eebb4d

Change-Id: I46acfd104ac3457126c3ccef5041788e4146321c
2017-05-02 09:04:59 +00:00
Hugo Benichi
783019d2ff Merge "NsdManager: unit test coverage for servive registration" am: b0e408450c am: bc57faa1ac
am: 9a3e69d9b6

Change-Id: Ideabb1c929ddd4307e66831cddb20e2feac2c6d9
2017-05-02 06:49:52 +00:00
Hugo Benichi
93f4591684 NsdManager: add test coverage for discoverServices()
Test: added new tests
Bug: 37013369, 33298084
Change-Id: If6c1113ee1bd4690db90abd5a61c3e229c827aec
2017-05-02 15:26:33 +09:00
Lorenzo Colitti
6b7553bc21 Merge "Add a method to start the captive portal login app." into oc-dev
am: 5555b1e3d1

Change-Id: Ic7c14bd3dfd07f97c04901f043ed1cd3b1eee6e4
2017-05-02 04:44:31 +00:00