Commit Graph

3834 Commits

Author SHA1 Message Date
Hugo Benichi
b9693f313b Finish moving NetworkStats tests to tests/net
Follow-up of commit 4ff3a778ab.

Also add @SmallTest annotation to classes moved to tests/net.

Test: no functional change
Bug: 32561414
Change-Id: I0a0e8865d37ba7bae06ce352d3fc385989adc300
2017-05-17 22:24:05 +09:00
Hugo Benichi
5ac64c51f5 Address ConnectivityManager API comments.
This patch is a cherry pick of the two following commits:
  - 139a48c83c which addresses several
    issues in the public api of ConnectivityManager.
  - 4c11db0fdd 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 139a48c83c)
2017-05-17 21:48:05 +09:00
Treehugger Robot
043ad49e0f Merge "Add tethering offload HAL call via JNI" 2017-05-17 07:09:15 +00:00
Erik Kline
deecb37d61 Merge "Add tethering offload HAL call via JNI" into oc-dev-plus-aosp
am: 652d17e238  -s ours

Change-Id: I7478fbe6c11a8543f96311e936b10d479442c42f
2017-05-17 05:14:06 +00:00
Erik Kline
df11e5b2b5 Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 8784c80e42)
2017-05-17 13:44:25 +09:00
Erik Kline
f0f891b39b Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Merged-In: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
(cherry picked from commit 8784c80e42)
2017-05-17 13:41:30 +09:00
Erik Kline
8784c80e42 Add tethering offload HAL call via JNI
Additionally, try to locate java Control interface.

Test: as follows
    - built
    - flashed
    - booted
    - OffloadController log messages observed, but only ever
      "not enabled" messages (needs a supporting implementation)
Bug: 29337859
Bug: 32163131
Bug: 34361337
Change-Id: I5251d05f2d2fd732a33a8955a6c346b3a2401e46
2017-05-17 11:31:45 +09:00
TreeHugger Robot
91bf2b5197 Merge "ConnectivityManager: fix documentation" 2017-05-16 14:31:28 +00:00
Hugo Benichi
b112d0ecc6 Merge "Remove unused import in ConnectivityManager" am: db6fc1afe8 am: fe098f8207 am: e13c192d0f
am: 216aae5188

Change-Id: I455d9712ad7f60f7474077435ff977c95b3b48c3
2017-05-16 13:34:37 +00:00
Hugo Benichi
216aae5188 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
5d426da614 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
4c11db0fdd ConnectivityManager: fix documentation
Documentation pointing to the registerNetwork() overload including a
timeout argument was pointing to the version removed by commit
139a48c83c. This makes it impossible to
cherry pick 139a48c83c 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
Hugo Benichi
9b477410e2 Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598 am: 88a3389b2c
am: 2ca1de8257

Change-Id: I252d293f37d29a53e1b5d913f682c0c16b2a122c
2017-05-15 06:24:57 +00:00
Hugo Benichi
2ca1de8257 Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598
am: 88a3389b2c

Change-Id: I5ce0d4a057edc0512f45d8cbf760bab1d2824183
2017-05-15 06:17:03 +00:00
Hugo Benichi
e522099415 ConnectivityService: minor formatting change
This patch adds a space character between "synchronized" and
"(mTheLockVariable)" so that all synchronized block have a consistent
syntax. Basic stats shows that "synchronized (" is x10 time more likely
than "synchronized(".

This facilitates finding all locked sections by grepping.

Test: no semantics changes
Bug: 37119619
Change-Id: Id860700efa85ffebafed11af3a2997bc115d9c03
2017-05-15 01:09:36 +00:00
Hugo Benichi
13be37d0a6 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
39294ce0cd Merge changes Ie762ce75,I611fd791 am: 21a57f263f am: cc9f695ba0
am: 164854bde2

Change-Id: I1495249f1ced84438dbd5dd0ad6678e2ee4062cb
2017-05-11 14:28:23 +00:00
Hugo Benichi
7abd43f6fb ConnectivityManager: unit test for argument validation
Bug: 36701874, 37107940
Test: new test passes
Change-Id: Ie762ce758b3d94052b7438a67fc55bef4690cbbb
2017-05-11 14:15:20 +09:00
Hugo Benichi
a590ab8373 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
58053ea138 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" into oc-dev am: f37b271894 -s ours
am: 4450146022  -s ours

Change-Id: Ia2b1ca862959fb685e6595f41dbfb130cdad6009
2017-05-10 08:49:28 +00:00
Hugo Benichi
4450146022 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" into oc-dev
am: f37b271894  -s ours

Change-Id: I28f139b2bc5a42eed4caf01bea7a1a9426a91625
2017-05-10 08:38:56 +00:00
Hugo Benichi
385211b75a Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 60c8870d97 am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: a1b1749c82

Change-Id: I97d5fcc43d6f11c05b74b29ebf3182a3ea7198c5
2017-05-10 02:12:15 +00:00
Hugo Benichi
89ea107828 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 60c8870d97 am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: f8dbdba5a2

Change-Id: Ie09f2b4e04749e61923781f4b13e796054108fad
2017-05-10 02:06:06 +00:00
Android Build Merger (Role)
a1b1749c82 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 60c8870d97 am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp 2017-05-10 00:47:39 +00:00
Hugo Benichi
97bf308ff6 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 60c8870d97 am: 76dc14ec88
am: 1697d48faf

Change-Id: I8b0cf31ef356aae9992f893ca35001d048999519
2017-05-10 00:44:51 +00:00
Hugo Benichi
d66a25ab97 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 60c8870d97 am: 76dc14ec88
am: 1697d48faf

Change-Id: I7dbfe3c96678e2325eb533f31523ad10d861ad02
2017-05-10 00:40:28 +00:00
Hugo Benichi
c34549c34c NetworkStatsFactory: fix double accounting on IPv6 only networks
For 464xlat scenarios on IPv6 networks, the clatd interface setup
introduces double counting of apps ipv4 traffic. NetworkStatsFactory was
accounting for this on the tx path, but not on the rx path. Also it did
not accounted for the 20 bytes added by the IPv6 header.

This patch subtract correctly the rx and tx traffic from the root uid on
the underlying interface, and also adds correctly the 20 bytes cost per
packet on the stacked interface for 464xlat traffic.

Test: added several new unit tests, based on synthetic data and real
      data also.
Bug: 33681750
Change-Id: I4867fe181938d94b5594b3d88896a3c4e01d895c
Merged-In: I2675643b220acbc6110179fa937d4c313b6f5e32

(cherry picked from commit e1bb3a14d1ee1aba2f92e5bccf659774699eaffe)
2017-05-10 09:19:12 +09:00
Hugo Benichi
60c8870d97 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" 2017-05-10 00:07:29 +00:00
Hugo Benichi
a884d4fc21 NetworkStatsFactory: fix double accounting on IPv6 only networks
For 464xlat scenarios on IPv6 networks, the clatd interface setup
introduces double counting of apps ipv4 traffic. NetworkStatsFactory was
accounting for this on the tx path, but not on the rx path. Also it did
not accounted for the 20 bytes added by the IPv6 header.

This patch subtract correctly the rx and tx traffic from the root uid on
the underlying interface, and also adds correctly the 20 bytes cost per
packet on the stacked interface for 464xlat traffic.

Test: added several new unit tests, based on synthetic data and real
      data also.
Bug: 33681750
Change-Id: I2675643b220acbc6110179fa937d4c313b6f5e32
2017-05-09 22:46:14 +09:00
Android Build Merger (Role)
b94bc1fd6b Merge "Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours am: c1cb5c3a8c -s ours" 2017-05-09 06:49:26 +00:00
Lorenzo Colitti
29b9aa2eb8 Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours
am: c1cb5c3a8c  -s ours

Change-Id: I40b5bb1e640358e6889f92dacdd2a977bc9758fb
2017-05-09 06:46:48 +00:00
Lorenzo Colitti
c1cb5c3a8c Merge "Move some NetworkStats tests to tests/net." into oc-dev
am: 74fe2cbc3a  -s ours

Change-Id: I4c58d302385c733108614c681632d3a8bc2dbdcf
2017-05-09 06:40:41 +00:00
Hugo Benichi
9a5cc37c6f Merge changes I4872f8ba,I92039f29,Iaad13e13 am: 767ac317e2 am: 717238a614 am: 44e9b81c54
am: ce04f07399

Change-Id: Ia0f85518fd0e75e768fa037c5d0bcf062b3c1f93
2017-05-09 06:39:13 +00:00
Hugo Benichi
ce04f07399 Merge changes I4872f8ba,I92039f29,Iaad13e13 am: 767ac317e2 am: 717238a614
am: 44e9b81c54

Change-Id: I9c38d1254f82b50f4d1e953e72bf15a46562d3b8
2017-05-09 06:30:48 +00:00
Hugo Benichi
0a118cefb8 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
Lorenzo Colitti
f7ffa460e4 Move some NetworkStats tests to tests/net.
This groups them together with the rest of the networking unit
tests. It also speeds up compile/test cycles ("runtest -x" of one
file goes from 1m15s to 30s).

Bug: 33681750
Test: runtest frameworks-net passes on internal tree
Merged-In: I53cb0c51355fe4b4b30e451fa09fbbf58da39efd
Change-Id: I5ae5dbf74c94feb0fe3759681e5e6d6fba62fa32

(cherry picked from commit c86013be936f36c61fa0cdfad95141f6de3c6ef7)
2017-05-08 08:38:08 +00:00
Hugo Benichi
959fb59018 Merge "NsdManager: add test coverage for discoverServices()" am: 3e21b1745c am: 60182dbe4e am: 27b0eebb4d
am: f828e46f2d

Change-Id: I2bbd97293d2887824b857d7e20fdc14d574bc097
2017-05-02 09:09:55 +00:00
Hugo Benichi
f828e46f2d 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
1f19af6a15 Merge "NsdManager: unit test coverage for servive registration" am: b0e408450c am: bc57faa1ac am: 9a3e69d9b6
am: 31b86a0a68

Change-Id: I88461d537e43fb086366dcc681b5ef2c2bdcdc2f
2017-05-02 06:56:15 +00:00
Hugo Benichi
31b86a0a68 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
3382f9fe27 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
27f6393faf Merge "Add a method to start the captive portal login app." into oc-dev am: 5555b1e3d1
am: d388cbb9e4

Change-Id: I65e9632d28e63ba3278a5f396554b7be302e20d1
2017-05-02 04:51:08 +00:00
Lorenzo Colitti
d388cbb9e4 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
Hugo Benichi
f04537fd28 NsdManager: unit test coverage for servive registration
This patch adds test coverage for NsdManager#registerService() and
NsdManager#unregisterService(). This test shows a potential defect in
the api: if unregisterService() fails, the associated listener is always
unregistered from NsdManager. If the service initially registered is
still registered, this potentially make it impossible to unregister.

Test: added new unit test
Bug: 37013369, 33298084
Change-Id: Ia089b6d2f2a349907a8b29d9a3acd7f59e177887
2017-05-02 13:31:24 +09:00
Lorenzo Colitti
500dbae1b5 Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: I82a9a9a8da47870ba3f1bbef5941b37e970c844f
2017-05-01 16:01:15 +09:00
Lorenzo Colitti
57ec8b82b6 Merge "Address ConnectivityManager API comments." into oc-dev am: 2121eeec48
am: a75dc7e122

Change-Id: I8f7ec6d4a2ee8c74e015fdff0ef83fe4218b4efd
2017-04-28 04:11:54 +00:00
Lorenzo Colitti
a75dc7e122 Merge "Address ConnectivityManager API comments." into oc-dev
am: 2121eeec48

Change-Id: I7024b4fe23ab12760fb452a59929df886912b104
2017-04-28 04:04:21 +00:00
Lorenzo Colitti
2121eeec48 Merge "Address ConnectivityManager API comments." into oc-dev 2017-04-28 03:58:16 +00:00
Lorenzo Colitti
139a48c83c Address ConnectivityManager API comments.
Bug: 36370941
Test: marlin builds and boots
Change-Id: I693ee5270bf186c88c7c5056293519f7237504ff
2017-04-28 00:58:00 +09:00
Hugo Benichi
47646a9fc1 Merge "NsdManager: unit tests for argument validation" am: 3cff7deecb am: d97e358f7a am: 48947de481
am: eebf240d12

Change-Id: I4c4251257c7ddcff82460dd71ff62adecd900420
2017-04-27 13:16:11 +00:00