180 Commits

Author SHA1 Message Date
Hugo Benichi
60182dbe4e Merge "NsdManager: add test coverage for discoverServices()"
am: 3e21b1745c

Change-Id: I0fd1d8e6ea3264a96b144c6701200f7b0be5f9c4
2017-05-02 08:54:46 +00:00
Treehugger Robot
3e21b1745c Merge "NsdManager: add test coverage for discoverServices()" 2017-05-02 08:44:29 +00:00
Hugo Benichi
bc57faa1ac Merge "NsdManager: unit test coverage for servive registration"
am: b0e408450c

Change-Id: I0b47ad5a1ccee4a2efb169d717b512a46ad4ecc2
2017-05-02 06:35:11 +00:00
Treehugger Robot
b0e408450c Merge "NsdManager: unit test coverage for servive registration" 2017-05-02 06:27:10 +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
Hugo Benichi
8c5eeb0afc 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
Erik Kline
241a7f15f2 Merge "Notify WifiManager of interface state changes"
am: 8e97274186

Change-Id: I6e9594805f9f55da53cf29e322829b1d2ff2f058
2017-04-28 08:04:31 +00:00
Erik Kline
216af6d3fe Notify WifiManager of interface state changes
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
      (except for an unrelated IpConnectivityMetricsTest error)
Bug: 31466854
Bug: 32163131
Change-Id: I702ea79eb2c02604761e4e1ebcd5f9e445178efb
2017-04-28 13:46:41 +09:00
Hugo Benichi
d97e358f7a Merge "NsdManager: unit tests for argument validation"
am: 3cff7deecb

Change-Id: I24d3bda00236fe8c49df0ea7f53109625b3b4f9d
2017-04-27 12:44:35 +00:00
Hugo Benichi
47748b754c Merge "NsdService: disentangle NativeDaemonConnector from ctor"
am: fa97f11b20

Change-Id: I4e5dc9df1f4de256b34c0140ea5ae7ec1bb6fce6
2017-04-27 12:39:00 +00:00
Hugo Benichi
52d9e733ae 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
1fac3191c7 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
dd53c962b2 Merge "NsdService: bootstrap unit tests"
am: 7ca060aa95

Change-Id: I3ce2d85afb5e085c8c49731f3d18a96d17542271
2017-04-27 05:34:05 +00:00
Hugo Benichi
7ca060aa95 Merge "NsdService: bootstrap unit tests" 2017-04-27 05:22:54 +00:00
Etan Cohen
3c6305cc55 Merge "[AWARE] Add UID checking to WifiAwareNetworkSpecifier"
am: 2fd19ffa06

Change-Id: I8e4a38b113d6e8f81bc382715dda5c279771e454
2017-04-25 13:27:22 +00:00
Etan Cohen
2fd19ffa06 Merge "[AWARE] Add UID checking to WifiAwareNetworkSpecifier" 2017-04-25 13:21:36 +00:00
Hugo Benichi
cbb13672bc 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
12c1074c8b Merge "Move byte logics from ApfFilter into BitsUtil"
am: 21b9b3a8ff

Change-Id: I9234b9dcb527de8a67bebab8cebc35e5b96aa986
2017-04-24 18:45:23 +00:00
Hugo Benichi
495a17b332 Move byte logics from ApfFilter into BitsUtil
This patch extracts into BitUtils byte manipulation helper methods
and unsigned type manipulation helper methods from ApfFilter into
an independent and reusable structure.

Test: $ runtest frameworks-net
Change-Id: I0f33af10457a63dbde5983f14353a79b8cd877d9
2017-04-22 10:07:03 +09:00
Hugo Benichi
40ab8401b2 Merge "NsdManager: add unit tests"
am: dc54ad7fc3

Change-Id: I928f19e359b7423d43d792c413de4195a64141a7
2017-04-22 00:40:56 +00:00
Hugo Benichi
dc54ad7fc3 Merge "NsdManager: add unit tests" 2017-04-22 00:31:28 +00:00
Robert Greenwalt
1778682242 Merge "Mark Restricted APN connections as restricted."
am: b90b2015d3

Change-Id: Icd54c671035da752663d9ec125f999298aa1d8e7
2017-04-21 23:23:17 +00:00
Treehugger Robot
b90b2015d3 Merge "Mark Restricted APN connections as restricted." 2017-04-21 23:12:52 +00:00
Robin Lee
cd8557d15a Merge "Use Vpn rules (not firewall) for always-on VPN"
am: e4f56a7e44

Change-Id: I80b3607fd1c61875be8354439e09db56a0bd391d
2017-04-21 22:05:33 +00:00
Robert Greenwalt
a7e148a874 Mark Restricted APN connections as restricted.
If anything unrestricted is bundled in the whole thing has to be
unrestricted (we can't restrict based on destination or intent)
but the NOT_METERED flag wasn't taken into account.

This wasn't a problem before because telephony set that statically
and late, but a change caused it to be marked NOT_METERED earlier
which exposed this bug.

bug: 37208956
Merged-In: I7b7a1c38621ce0ecde8cf041e82b1ebb7a9c6f15
Test: new NetworkCapabilitiesTest.  Fails without fix, works with.
Change-Id: I86c1b2854413a94662aa53e697d32380695ab9ac
2017-04-21 22:00:17 +00:00
Treehugger Robot
e4f56a7e44 Merge "Use Vpn rules (not firewall) for always-on VPN" 2017-04-21 21:53:15 +00:00
Etan Cohen
859748f08c [AWARE] Add UID checking to WifiAwareNetworkSpecifier
Wifi Aware networks are per app - i.e. a requestor gets
a dedicated network. Change verifies that the only the
original requestor matches the created network (using UID).

Bug: 36053921
Test: Integration (sl4a) tests
Change-Id: I4ff3994731dd7ccb88e2bea333d1e6905b136f02
2017-04-21 18:47:35 +00:00
Erik Kline
f7c93bcd45 Merge "Clarify IControlsTethering LOCAL_ONLY state name"
am: 649c459858

Change-Id: Ia856b08ced4e26e32e107faac37e1c245caaf910
2017-04-21 09:07:46 +00:00
Hugo Benichi
db8adb7983 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
Erik Kline
ca41be796a Clarify IControlsTethering LOCAL_ONLY state name
Test: as follows
    - build
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I1f45511f00aca37480f894be4a9a004f1a3b35d7
2017-04-21 11:12:24 +09:00
Erik Kline
11fdd1769b Merge "Switch to WifiManager.{start,stop}SoftAp()"
am: 275edcb940

Change-Id: I697bf530da9786da4ed1405ac8b44b7bc4d097a6
2017-04-20 15:50:19 +00:00
Treehugger Robot
275edcb940 Merge "Switch to WifiManager.{start,stop}SoftAp()" 2017-04-20 15:37:31 +00:00
Erik Kline
6af3dd0fc3 Merge "Add local-only hotspot info into tether state change broadcast"
am: 4c7a999d79

Change-Id: I911be691b15604a63aa02bf4db607ae1cd701cfe
2017-04-20 12:55:48 +00:00
Erik Kline
8351faa900 Add local-only hotspot info into tether state change broadcast
Test: as follows
    - build
    - flashed
    - booted
    - "runtest frameworks-net" passes
    - manually starting tethering shows Settings and icon updates
Bug: 31466854
Bug: 32163131

Change-Id: I938074587dfeec221c5cdb43a392802ad3fc3589
2017-04-20 19:44:01 +09:00
Erik Kline
ceb54c63dc Switch to WifiManager.{start,stop}SoftAp()
Test: as follows
    - built
    - flashed
    - booted
    - "runtest frameworks-net" passes
Bug: 31466854

Change-Id: I730d029128a14b936c111ae159b9708d935f4656
2017-04-18 15:22:49 +09:00
Hugo Benichi
4d80366762 Merge "ConnectivityManager: release all requests mapping to a callback."
am: 1a8f04b1b2

Change-Id: I30d3790822430d250d6005cc165e7fa10f56649e
2017-04-14 15:22:39 +00:00
Hugo Benichi
dafed3d008 ConnectivityManager: release all requests mapping to a callback.
This patch changes how callback unregistration works in order to be
consistent with undocumented use cases currently de-facto supported
by the API (although in a buggy way):
  - callback recycling: releasing then reregistering a callback again.
  - multiple request registrations with the same callback.

The second use case is not desirable but needs to be taken into account
for now for the purpose of correctly releasing NetworkRequests
registered in ConnectivityService.

In order to support request release in both use cases with minimal
amount of complexity for the time being the following changes are done:
  - request to callback unmapping is done synchronously at callback
    release time.
  - all requests associated to a callback are unmapped at callback
    release time.

This fixes the following issues:
  - a callback stops being triggered as soon as it is released.
    Otherwise when recycling the callback immediately, it is possible
    the previous request associated with it triggers it, confusing the
    app.
  - when a callback is registered multiple times, the requests are not
    leaked.
  - when a callback is registered multiple times and then released, the
    N-1 first registrations do not trigger the callback anymore.

In the future it would be desirable to enforce the intended 1:1 mapping
between callbacks and requests at registration time.

Bug: 35921499, 35955593, 20701525
Test: - added new tests in ConnectivityManagerTest to test releasing,
      recycling, and a disabled test for no multiple regristration.
      - new tests catch regression causing b/35921499, b/35955593.
Change-Id: Ia0917ac322fc049f76adb4743bc745989fed6d26
2017-04-14 22:17:21 +09:00
Erik Kline
85f5725fb5 Merge "Extract SimChangeListener to its own file"
am: 0ef8df6d52

Change-Id: Ib83aa0acc1cf19c04ed94a198bb8333c7e3a60b8
2017-04-13 08:33:12 +00:00
Treehugger Robot
0ef8df6d52 Merge "Extract SimChangeListener to its own file" 2017-04-13 08:19:07 +00:00
Lorenzo Colitti
67401e25c2 Merge "Move some NetworkStats tests to tests/net."
am: ab3901dc8b

Change-Id: I68214c14658afbb5c92facb018988d2ed27bc351
2017-04-13 05:29:58 +00:00
Lorenzo Colitti
ab3901dc8b Merge "Move some NetworkStats tests to tests/net." 2017-04-13 05:18:47 +00:00
Lorenzo Colitti
362bef45d1 Merge changes from topic 'network_specifier'
am: d0f476bdae

Change-Id: I783b2d06f3a5e8b9cd7940f1f1ef0dd951c734f1
2017-04-12 22:43:03 +00:00
Lorenzo Colitti
d0f476bdae Merge changes from topic 'network_specifier'
* changes:
  [CM] Unhide the NetworkSpecifier as object API
  Make the NetworkSpecifier a class instead of a string.
2017-04-12 22:27:37 +00:00
Lorenzo Colitti
c86013be93 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).

Test: runtest frameworks-net passes on internal tree
Change-Id: I53cb0c51355fe4b4b30e451fa09fbbf58da39efd
2017-04-13 02:38:11 +09:00
Erik Kline
227648f336 Extract SimChangeListener to its own file
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - runtest -x full/path/to/SimChangeListenerTest.java passes
Bug: 32163131
Change-Id: If90539fe9a5dc07c7c24ed0b70b920d94065a623
2017-04-12 15:57:49 +09:00
Erik Kline
908ce167eb Merge "Tethering: support Local-only Hotspot mode for downstreams"
am: d3128d4b55

Change-Id: Ic7d5e3e23f9ccc0f094ba5991e2fdefa82865b01
2017-04-10 12:02:49 +00:00
Erik Kline
ea9cc488eb Tethering: support Local-only Hotspot mode for downstreams
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - "runtest frameworks-net" passes
Bug: 31466854

Change-Id: Ia50e28c8ce0af8cdd7ac63217d921aff213668e7
2017-04-10 19:11:08 +09:00
Lorenzo Colitti
0ad718aab1 Merge "Add an API hint for metered multipath traffic."
am: 7a12f7efc7

Change-Id: Ie0d289460f93d3b93d91545eb3dfa925f0bdee5f
2017-04-10 05:48:34 +00:00
Treehugger Robot
7a12f7efc7 Merge "Add an API hint for metered multipath traffic." 2017-04-10 05:40:10 +00:00
Hugo Benichi
fa0dadc540 DO NOT MERGE IP connectivity metrics: fix tests.
This patch fixes mismatch between current proto compiler and what is
expected in several IP connectivity metrics unit tests.

Test: built, flashed, $ runtest frameworks-net
Bug: 37126521
Change-Id: I1476c923d61f748ecac1146423127f54ba117502
2017-04-10 13:19:23 +09:00