Commit Graph

3723 Commits

Author SHA1 Message Date
Hugo Benichi
e73017a135 ConnectivityManager: fix documentation
Documentation pointing to the registerNetwork() overload including a
timeout argument was pointing to the version removed by commit
38ea810b27. This makes it impossible to
cherry pick 38ea810b27 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
77ddfa4781 Merge "ConnectivityService: minor formatting change" am: 4c949ee07c am: 9374e0b598 am: 88a3389b2c
am: 172cf14807

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

Change-Id: I5ce0d4a057edc0512f45d8cbf760bab1d2824183
2017-05-15 06:17:03 +00:00
Hugo Benichi
478587688c 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
2e39aebd6b 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
7d82c66d31 Merge changes Ie762ce75,I611fd791 am: 21a57f263f am: cc9f695ba0
am: 164854bde2

Change-Id: I1495249f1ced84438dbd5dd0ad6678e2ee4062cb
2017-05-11 14:28:23 +00:00
Hugo Benichi
edcc374b3c 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
145e379d5d 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
88216649e1 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" into oc-dev am: f37b271894 -s ours
am: bb19c87d68  -s ours

Change-Id: Ia2b1ca862959fb685e6595f41dbfb130cdad6009
2017-05-10 08:49:28 +00:00
Hugo Benichi
bb19c87d68 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
053b8f91b6 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 183d968881 am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: 18d29a6ee8

Change-Id: I97d5fcc43d6f11c05b74b29ebf3182a3ea7198c5
2017-05-10 02:12:15 +00:00
Hugo Benichi
ae49870916 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 183d968881 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)
18d29a6ee8 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 183d968881 am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp 2017-05-10 00:47:39 +00:00
Hugo Benichi
2362279537 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: 183d968881 am: 76dc14ec88
am: 1697d48faf

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

Change-Id: I7dbfe3c96678e2325eb533f31523ad10d861ad02
2017-05-10 00:40:28 +00:00
Hugo Benichi
6c07bead32 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
183d968881 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" 2017-05-10 00:07:29 +00:00
Hugo Benichi
043095b615 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)
82899a874a Merge "Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours am: 1217cfd0c3 -s ours" 2017-05-09 06:49:26 +00:00
Lorenzo Colitti
d43686fd6a Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours
am: 1217cfd0c3  -s ours

Change-Id: I40b5bb1e640358e6889f92dacdd2a977bc9758fb
2017-05-09 06:46:48 +00:00
Lorenzo Colitti
1217cfd0c3 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
0313b3cbf7 Merge changes I4872f8ba,I92039f29,Iaad13e13 am: 767ac317e2 am: 717238a614 am: 44e9b81c54
am: 4799bdc8fa

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

Change-Id: I9c38d1254f82b50f4d1e953e72bf15a46562d3b8
2017-05-09 06:30:48 +00:00
Hugo Benichi
fc28684dda 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
2d33d8d3f5 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
a0e77edc9e Merge "NsdManager: add test coverage for discoverServices()" am: 3e21b1745c am: 60182dbe4e am: 27b0eebb4d
am: 66e8ca2dd0

Change-Id: I2bbd97293d2887824b857d7e20fdc14d574bc097
2017-05-02 09:09:55 +00:00
Hugo Benichi
66e8ca2dd0 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
fd587d55c8 Merge "NsdManager: unit test coverage for servive registration" am: b0e408450c am: bc57faa1ac am: 9a3e69d9b6
am: 4c1fa0a879

Change-Id: I88461d537e43fb086366dcc681b5ef2c2bdcdc2f
2017-05-02 06:56:15 +00:00
Hugo Benichi
4c1fa0a879 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
0cf8c59a45 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
29fd201d7b Merge "Add a method to start the captive portal login app." into oc-dev am: 5555b1e3d1
am: 4d3453c255

Change-Id: I65e9632d28e63ba3278a5f396554b7be302e20d1
2017-05-02 04:51:08 +00:00
Lorenzo Colitti
4d3453c255 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
b00460ae8e 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
755e796e5e 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
67288eb53d Merge "Address ConnectivityManager API comments." into oc-dev am: f782c1d836
am: 5a8680d7a4

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

Change-Id: I7024b4fe23ab12760fb452a59929df886912b104
2017-04-28 04:04:21 +00:00
Lorenzo Colitti
f782c1d836 Merge "Address ConnectivityManager API comments." into oc-dev 2017-04-28 03:58:16 +00:00
Lorenzo Colitti
38ea810b27 Address ConnectivityManager API comments.
Bug: 36370941
Test: marlin builds and boots
Change-Id: I693ee5270bf186c88c7c5056293519f7237504ff
2017-04-28 00:58:00 +09:00
Hugo Benichi
c39f81e439 Merge "NsdManager: unit tests for argument validation" am: 3cff7deecb am: d97e358f7a am: 48947de481
am: 0e50827fea

Change-Id: I4c4251257c7ddcff82460dd71ff62adecd900420
2017-04-27 13:16:11 +00:00
Hugo Benichi
8aaf306011 Merge "NsdService: disentangle NativeDaemonConnector from ctor" am: fa97f11b20 am: 47748b754c am: 5d0bd13538
am: b2ce5b2847

Change-Id: Ie0a42ede086cc480830c91e770eaf250bcd2f711
2017-04-27 13:14:10 +00:00
Hugo Benichi
0e50827fea Merge "NsdManager: unit tests for argument validation" am: 3cff7deecb am: d97e358f7a
am: 48947de481

Change-Id: I8a51ff51071adc60fe9f4d99ec629edabbed353d
2017-04-27 13:09:02 +00:00
Hugo Benichi
b2ce5b2847 Merge "NsdService: disentangle NativeDaemonConnector from ctor" am: fa97f11b20 am: 47748b754c
am: 5d0bd13538

Change-Id: Ic8ddf92c7c64d4214a75bea6d6e5083f4612a76a
2017-04-27 13:06:59 +00:00
Hugo Benichi
99917e5cfb NsdManager: unit tests for argument validation
Test: new tests pass.
Bug: 37013369, 33298084
Change-Id: Ia514d2bbd967d46fed54e379f319b572ade22c62
2017-04-27 16:35:48 +09:00
Hugo Benichi
ee4eb706eb NsdService: disentangle NativeDaemonConnector from ctor
This patch disentangles the creation of NativeDaemonConnector from the
creation of NsdService by introducing a wrapper type DaemonConnection.

This allows to mock this dependency in unit tests.

Test: enhanced previously introduced new tests.
Bug: 37013369, 33298084
Change-Id: I894b7cddfc509f86d0134d214c88c063b81b5e0a
2017-04-27 16:35:30 +09:00
Hugo Benichi
f5ca9cc774 Merge "NsdService: bootstrap unit tests" am: 163201bd74 am: dd53c962b2 am: d29ce6ae8c
am: 3489494edc

Change-Id: I018d6fbface4a9d4a568486dedd30d05e0ddd949
2017-04-27 06:01:38 +00:00
Hugo Benichi
3489494edc Merge "NsdService: bootstrap unit tests" am: 163201bd74 am: dd53c962b2
am: d29ce6ae8c

Change-Id: Iaf0679790e934baaaf48bcb04098aa18deca4d60
2017-04-27 05:49:47 +00:00
Hugo Benichi
163201bd74 Merge "NsdService: bootstrap unit tests" 2017-04-27 05:22:54 +00:00
Erik Kline
a02a6b1658 Merge "Clarify some IpManager/ApfFilter debugging output." into oc-dev am: 40ccb1b5aa
am: 00dc131391

Change-Id: Iec4ab9cadefb9de773e73a124d40ac5f69b8136d
2017-04-27 04:08:10 +00:00
Erik Kline
00dc131391 Merge "Clarify some IpManager/ApfFilter debugging output." into oc-dev
am: 40ccb1b5aa

Change-Id: Ie883f62bdc731c8da3b3d5ac1df827e1fd5b44be
2017-04-27 03:58:12 +00:00
Erik Kline
9ee878a8bb Merge "Clarify some IpManager/ApfFilter debugging output." am: ce94c07ffd am: 3cc7ccfc69 am: b1914ebb50
am: b3da49d3fb

Change-Id: I7ff76ff8602477586d2fd315c730203f28744027
2017-04-27 00:46:41 +00:00