Commit Graph

817 Commits

Author SHA1 Message Date
Hugo Benichi
e8a2ba93eb Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: f8dbdba5a2

Change-Id: Ie09f2b4e04749e61923781f4b13e796054108fad
2017-05-10 02:06:06 +00:00
Hugo Benichi
286734b834 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88
am: 1697d48faf

Change-Id: I7dbfe3c96678e2325eb533f31523ad10d861ad02
2017-05-10 00:40:28 +00:00
Hugo Benichi
ce730270bc Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" 2017-05-10 00:07:29 +00:00
Hugo Benichi
6d58a32565 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)
7adfa61ddd Merge "Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours am: ea28d269ea -s ours" 2017-05-09 06:49:26 +00:00
Lorenzo Colitti
6290dd23db Merge "Move some NetworkStats tests to tests/net." into oc-dev am: 74fe2cbc3a -s ours
am: ea28d269ea  -s ours

Change-Id: I40b5bb1e640358e6889f92dacdd2a977bc9758fb
2017-05-09 06:46:48 +00:00
Hugo Benichi
66f318d1c6 Merge changes I4872f8ba,I92039f29,Iaad13e13 am: 767ac317e2 am: 717238a614 am: 44e9b81c54
am: 20f5ef9065

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

Change-Id: I9c38d1254f82b50f4d1e953e72bf15a46562d3b8
2017-05-09 06:30:48 +00:00
Hugo Benichi
d2552aee11 NsdService: simple cleanups
This patch replace some SparseArray<Integer> with SparseIntArray, and
simplify a value lookup function by using indexOfValue().

Test: TODO
Bug: 37013369, 33298084
Change-Id: I4872f8baa2bb2ff456c7f848d3afe2e7bcc9892e
2017-05-09 10:49:34 +09:00
Hugo Benichi
4dd4db7720 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
f2c64f8725 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
Hugo Benichi
5af0be7729 Merge "NsdManager: add test coverage for discoverServices()" am: 3e21b1745c am: 60182dbe4e am: 27b0eebb4d
am: 284ecaa201

Change-Id: I2bbd97293d2887824b857d7e20fdc14d574bc097
2017-05-02 09:09:55 +00:00
Hugo Benichi
284ecaa201 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
be9b90264c Merge "NsdManager: unit test coverage for servive registration" am: b0e408450c am: bc57faa1ac am: 9a3e69d9b6
am: 459c68c725

Change-Id: I88461d537e43fb086366dcc681b5ef2c2bdcdc2f
2017-05-02 06:56:15 +00:00
Hugo Benichi
459c68c725 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
287730e764 NsdManager: add test coverage for discoverServices()
Test: added new tests
Bug: 37013369, 33298084
Change-Id: If6c1113ee1bd4690db90abd5a61c3e229c827aec
2017-05-02 15:26:33 +09:00
Hugo Benichi
3ec710f6f0 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
Hugo Benichi
4801469256 Merge "NsdService: disentangle NativeDaemonConnector from ctor" am: fa97f11b20 am: 47748b754c am: 5d0bd13538
am: f659a6775f

Change-Id: Ie0a42ede086cc480830c91e770eaf250bcd2f711
2017-04-27 13:14:10 +00:00
Hugo Benichi
f659a6775f 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
6d70644998 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
b1347c6287 Merge "NsdService: bootstrap unit tests" am: ec33961ae0 am: dd53c962b2 am: d29ce6ae8c
am: 9fc7343cfb

Change-Id: I018d6fbface4a9d4a568486dedd30d05e0ddd949
2017-04-27 06:01:38 +00:00
Hugo Benichi
9fc7343cfb Merge "NsdService: bootstrap unit tests" am: ec33961ae0 am: dd53c962b2
am: d29ce6ae8c

Change-Id: Iaf0679790e934baaaf48bcb04098aa18deca4d60
2017-04-27 05:49:47 +00:00
Hugo Benichi
ec33961ae0 Merge "NsdService: bootstrap unit tests" 2017-04-27 05:22:54 +00:00
Nathan Harold
9f9a2241e1 Merge "Hide IpSecManager, IpSecTransform, and IpSecAlgorithm" into oc-dev am: 35eb324bf1
am: 0d579f8794

Change-Id: Idf7ca8bc14ba2502ed35fbaa452f7eb49a66be78
2017-04-26 18:17:40 +00:00
Nathan Harold
0d579f8794 Merge "Hide IpSecManager, IpSecTransform, and IpSecAlgorithm" into oc-dev
am: 35eb324bf1

Change-Id: Iba429d1d96e28ccaf95d721b8b13cd107d4a0454
2017-04-26 18:10:04 +00:00
nharold
39d54ca4e3 Merge "Hide IpSecManager, IpSecTransform, and IpSecAlgorithm" am: 01e368f26d am: 939528045a am: 52dab83f7a
am: ee588f0304

Change-Id: Id67890a061c4e7aef91c7dea61e8706cfdd6bc6e
2017-04-26 17:52:39 +00:00
nharold
ee588f0304 Merge "Hide IpSecManager, IpSecTransform, and IpSecAlgorithm" am: 01e368f26d am: 939528045a
am: 52dab83f7a

Change-Id: I3bf240b35c3d509c4e016ffe20519c1bda5ab0b3
2017-04-26 17:38:58 +00:00
Nathan Harold
185f2ccd1c Hide IpSecManager, IpSecTransform, and IpSecAlgorithm
These classes, originally planned to be part of the
public API, are not ready for public consumption.
They are planned to be un-hidden in a future release.

Bug: 37681043
Test: make update-api and make
Change-Id: I8caccd3f8455341cb56a2256354eacbadedff047
2017-04-26 06:50:54 +00:00
Nathan Harold
7194bb9bf9 Hide IpSecManager, IpSecTransform, and IpSecAlgorithm
These classes, originally planned to be part of the
public API, are not ready for public consumption.
They are planned to be un-hidden in a future release.

Bug: 37681043
Test: make update-api and make
Merged-In: I8caccd3f8455341cb56a2256354eacbadedff047
Change-Id: I8caccd3f8455341cb56a2256354eacbadedff047
(cherry picked from commit e38565fc74ee19e27175782be3cf2f0dffefd3a6)
2017-04-25 16:53:50 -07:00
Hugo Benichi
803a2f073f NsdService: bootstrap unit tests
Test: new tests part of $ runtest frameworks-net
Bug: 37013369, 33298084
Change-Id: Ief45f838268380b4b2a128390fbf34d55a3b922b
2017-04-25 10:42:58 +09:00
Hugo Benichi
eb924c44ef Merge "NsdManager: add unit tests" am: dc54ad7fc3 am: 40ab8401b2 am: d2181235b9
am: 3b40687000

Change-Id: I86a9db7fe4f925162e1632152862c7b246230db9
2017-04-22 01:06:17 +00:00
Hugo Benichi
3b40687000 Merge "NsdManager: add unit tests" am: dc54ad7fc3 am: 40ab8401b2
am: d2181235b9

Change-Id: I7a5202be0e6a6274f3bd11737f30fee0ef947235
2017-04-22 00:57:48 +00:00
Hugo Benichi
0b1540e40d NsdManager: add unit tests
This prepares some refactoring and the addition of a timeout to
resolveService.

Test: new tests pass
Bug: 37013369, 33298084
Change-Id: Ie8277bd5983278507bfa70495b4ce7d13895b24b
2017-04-21 05:16:37 +00:00
Hugo Benichi
0ebf8234f9 Merge changes Ic029cc9f,Id917f3a2 into oc-dev am: 4a786f94c2 -s ours
am: 088a9c77d9  -s ours

Change-Id: I724372ba07b4f6008e0e9240d65842b3712f56d3
2017-04-20 16:06:27 +00:00
Hugo Benichi
088a9c77d9 Merge changes Ic029cc9f,Id917f3a2 into oc-dev
am: 4a786f94c2  -s ours

Change-Id: I2c62317b3a03edab06aa72d21e801d4355a85106
2017-04-20 04:34:48 +00:00
Hugo Benichi
4a786f94c2 Merge changes Ic029cc9f,Id917f3a2 into oc-dev
* changes:
  NsdService: minor cleanups
  Nsdmanager/NsdService: add logging
2017-04-20 04:27:50 +00:00
Hugo Benichi
5d4c5a2f5c NsdService: minor cleanups
Minor cleanups in switches of processMessage and handleNativeEvent.

Test: no functional changes
Bug: 33074219

(cherry picked from commit 23dba85fff01a9f51beea8ce811fc98b582f8e71)

Merged-In: I9ad4ce812c0d2c02a671a7a871ad427e4ce29b4a
Change-Id: Ic029cc9fa007d8c485f64f4afcbd4dc10da1ae29
2017-04-20 01:36:30 +00:00
Nathan Harold
d8ab7b0e63 Merge "Hide Socket+DatagramSocket IpSecTransform methods" into oc-dev am: fca728da6c
am: ef10a18ac4

Change-Id: I0be0f0930226a99bdc6d0fc3403836a329cda5be
2017-04-19 01:06:23 +00:00
Nathan Harold
ef10a18ac4 Merge "Hide Socket+DatagramSocket IpSecTransform methods" into oc-dev
am: fca728da6c

Change-Id: I64e9e5076b26562f3faaad8fb1a201d0933e8f50
2017-04-19 00:58:26 +00:00
Nathan Harold
2465e40b7d Merge "Consistenly Throw IOExceptions from IpSecManager" into oc-dev am: 01307a7e94 -s ours
am: ce1cec4741

Change-Id: I6c70846cb8b8dbe80aacce8cd9aa80e61a406acb
2017-04-19 00:56:49 +00:00
Nathan Harold
ce1cec4741 Merge "Consistenly Throw IOExceptions from IpSecManager" into oc-dev
am: 01307a7e94  -s ours

Change-Id: Id6b155b29ef23961b4c3303a2f35d1701c9f8478
2017-04-19 00:52:35 +00:00
nharold
85dee22023 Merge changes from topic 'ipsec-hide-overloads' am: fe358c6adf am: 8508bc52d2 am: 6eab2ee093
am: d19fe145b9

Change-Id: I8e88fe65b649e92e900c343862207bfd6089003d
2017-04-18 22:24:54 +00:00
Nathan Harold
4bba309fc0 Consistenly Throw IOExceptions from IpSecManager am: a64b019f94 am: 5db180bbb7 am: 7883c5d460
am: 31af88727b

Change-Id: If303276e7bd6a12a981492043a3d5e9a422d20b8
2017-04-18 22:23:52 +00:00
nharold
d19fe145b9 Merge changes from topic 'ipsec-hide-overloads' am: fe358c6adf am: 8508bc52d2
am: 6eab2ee093

Change-Id: Iaa713ba4b20bab12331bd996288ed2440c349db2
2017-04-18 22:12:54 +00:00
Nathan Harold
31af88727b Consistenly Throw IOExceptions from IpSecManager am: a64b019f94 am: 5db180bbb7
am: 7883c5d460

Change-Id: I04198299d43da4c9c91f705acc5520f734ad9249
2017-04-18 22:11:18 +00:00
Nathan Harold
b2b85df5d6 Hide Socket+DatagramSocket IpSecTransform methods
These methods do not currently work for IPv4 sockets,
so they need to be hidden until the underlying kernel
code can be made to work properly in a dual-stack
environment.

Bug: 36073210
Test: compilation
Merged-In: Idce367f638a42da374a7f1dc5ebb8931c9555e06
Change-Id: Idce367f638a42da374a7f1dc5ebb8931c9555e06
(cherry picked from commit da18b028f85e9a2c969c636aea6abf7f4bac3922)
2017-04-17 20:23:51 -07:00
Nathan Harold
2528c66a66 Consistenly Throw IOExceptions from IpSecManager
Bug: 36073210
Test: api-update
Change-Id: Ia3825e85b09b6330f1326a26cf9e1cadf9dacf71
Merged-In: Ia3825e85b09b6330f1326a26cf9e1cadf9dacf71
(cherry picked from commit c2fd6cfdc9dce33d57a3c2780e0527dd4b1bfeb9)
2017-04-17 20:23:34 -07:00
Nathan Harold
4b909c85f6 Hide Socket+DatagramSocket IpSecTransform methods
These methods do not currently work for IPv4 sockets,
so they need to be hidden until the underlying kernel
code can be made to work properly in a dual-stack
environment.

Bug: 36073210
Test: compilation
Change-Id: Idce367f638a42da374a7f1dc5ebb8931c9555e06
2017-04-17 19:41:08 -07:00
Nathan Harold
a64b019f94 Consistenly Throw IOExceptions from IpSecManager
Bug: 36073210
Test: api-update
Change-Id: Ia3825e85b09b6330f1326a26cf9e1cadf9dacf71
2017-04-17 17:57:41 -07:00
Hugo Benichi
b6389543d4 Nsdmanager/NsdService: add logging
This patch adds basic logging to NsdManager and NsdService, and improves
the facilities for pretty printing the event ids defined in NsdManager.

It also includes a few minor cleanups:
  - adding 'final' on effectively final instance variables of NsdManager
  and NsdService.
  - similarly, adding 'static' on effectively static class fields.
  - regrouping instance variables together.

Test: no functional changes
Bug: 33074219

(cherry picked from commit 2183ba9b5f8eb54c74cd198a7506b21319794e99)

Merged-In: I360d539e73cc8e4b45d4e0d20b2e345455fdb10c
Change-Id: Id917f3a2085d17f277850af36a2cf859e3614a0f
2017-04-17 10:07:05 +09:00