139 Commits

Author SHA1 Message Date
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
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
Lorenzo Colitti
46aa9c022e Add an API hint for metered multipath traffic.
This allows an application that knows how to provide seamless
network connectivity (e.g., using QUIC multipath) to find out if
doing so is desired.

(cherry picked from commit 2de4925f5cc64aeb92e02a8f740d3ff20f36dddd)

Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087
2017-04-06 16:50:06 +09:00
Etan Cohen
a743427896 Make the NetworkSpecifier a class instead of a string.
Bug: 27533960
Bug: 36053921
Bug: 36275276
Test: connectivity, wifi, telephony unit tests
Change-Id: Idd9b10a8418c53c8cf386d9ff8252226b076bbf9
2017-04-05 14:18:20 -07:00
Lorenzo Colitti
0e068f6360 Merge "Add test coverage for NetworkSpecifiers."
am: 9a029b5262

Change-Id: Ia328b945af4c4f55ef560b33b00fa861b8f81b0d
2017-04-03 10:45:22 +00:00
Lorenzo Colitti
6556a220d7 Add test coverage for NetworkSpecifiers.
Tests various combinations of empty / non-empty NetworkSpecifiers
and changing specifiers on the fly.

Test: ConnectivityServiceTest passes
Bug: 27533960
Change-Id: Ibd6b4efc861dc51689e46f3882ba859223411bf0
2017-04-03 17:46:35 +09:00
Robin Lee
e61a30f635 Merge "Move some VPN logic out of ConnectivityService"
am: ec86462033

Change-Id: I212c2d6de1676ab65e6bbf34148d66e183d60c62
2017-03-30 16:08:50 +00:00
Robin Lee
ec86462033 Merge "Move some VPN logic out of ConnectivityService" 2017-03-30 16:00:41 +00:00
Lorenzo Colitti
0a34afb48d Merge changes If94102c7,I8d51e8e0
am: 22b829c049

Change-Id: I8aa529a05fc40241ec9664775ca0ebd8960098a8
2017-03-28 12:33:28 +00:00
Lorenzo Colitti
42cdf57703 Make ConnectivityServiceTest pass on wifi-only devices.
Test: ConnectivityServiceTest passes on ryu on internal master
Test: ConnectivityServiceTest passes on bullhead
Change-Id: If94102c7df0257ea9e69e72b07a685ae3c2c4022
2017-03-28 12:53:06 +09:00
Robin Lee
b8c2a2b850 Move some VPN logic out of ConnectivityService
This cleanup helps declutter ConnectivityService, and encapsulates the
always-on setting inside of Vpn instead of spreading it across two
classes.

In particular having the save code in one file and the load code in
another file was weird and I apologise for that.

Added a SystemServices wrapper for Settings.Secure and PendingIntent
calls to decouple some of the global state nastiness and make it
testable without forcing ConnectivityService to drive the load/save.

Test: runtest -x tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: runtest -x tests/net/java/com/android/server/connectivity/VpnTest.java
Bug: 33159037
Change-Id: Ie2adb1c377adfcef0a5900dc866e6118f451b265
2017-03-27 13:40:51 +01:00
Erik Kline
dea2371e71 Merge "Address some comments on IpManagerTest"
am: b2afa1ede5

Change-Id: Ic986c23c693757b8311e0de0c0a94281db67f62d
2017-03-14 06:08:34 +00:00
Erik Kline
246bc1f795 Address some comments on IpManagerTest
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 26991160
Change-Id: Ib543874188537e31422206d67d1760762a7c85cd
2017-03-14 13:02:49 +09:00
Erik Kline
cf07e0d541 Merge "Skeleton of an IpManagerTest"
am: db4333a2c2

Change-Id: I5817c2458c222afb85389deaf22b43d245577b2a
2017-03-14 03:11:15 +00:00
Erik Kline
aa95ae57ec Skeleton of an IpManagerTest
Test: as follows
    - biult (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 26991160
Change-Id: Idddddf0c1a7a8d0a8acff8a5526b02a533d5f3ec
2017-03-14 10:19:52 +09:00
Erik Kline
0f901af920 Merge "request{LinkProperties,NetworkCapabilities} no longer needed"
am: 75dfc5bd91

Change-Id: I79b9323be242ed5d2bf83962f78c613a465a20b8
2017-03-07 13:33:29 +00:00
Erik Kline
465c46d555 request{LinkProperties,NetworkCapabilities} no longer needed
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - manual USB tethering toggling between WiFi and mobile
Bug: 32163131
Change-Id: I57edf5114b6361f320577c7870e40f8b3cdf74ce
2017-03-07 17:18:06 +09:00
Erik Kline
e0a62a4398 Merge "Always send all available state when calling onAvailable()."
am: affbb8b6a9

Change-Id: I81e70fecf060a4103b51084a60a32c78f6219f6b
2017-03-07 06:00:09 +00:00
Erik Kline
c75d4fad22 Always send all available state when calling onAvailable().
The state that needs to be transferred includes:
    - NetworkCapabilities
    - LinkProperties
    - whether the network is currently suspended

Additionally:
    - Rename notifyNetworkCallback() to notifyNetworkAvailable()
      in order to clarify its real function.
    - fix previous copy/paste error in unittest

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - USB tethering with mobile and Wi-Fi upstream toggling
Bug: 32163131
Change-Id: Ib4460bcd5d08863a9feac9e8ab41a238897bb3ea
2017-03-07 12:57:26 +09:00
Hugo Benichi
4cf199383f Merge "Revert "ConnectivityManager: no double NetworkCallback registration" because oit caused regressions http://b/35955593, http://b/35921499."
am: 704520c392

Change-Id: Ia0ae78f8406b81377491407cf5ef8ca339952def
2017-03-06 12:30:05 +00:00
Hugo Benichi
649e32484e Revert "ConnectivityManager: no double NetworkCallback registration" because oit caused regressions http://b/35955593, http://b/35921499.
This reverts commit faa70976b490116323107166f90fdd944c5bdc77.

Change-Id: I86c07c113f24753be7c977e6d7f570b99391e1b5
2017-03-06 06:16:51 +00:00
Hugo Benichi
5983a772cb Merge "ConnectivityManager: no double NetworkCallback registration"
am: 06a192fa49

Change-Id: I250fa7d3c5e37a66caa41cc898a44bcb18c9a0c4
2017-03-02 08:04:03 +00:00
Hugo Benichi
faa70976b4 ConnectivityManager: no double NetworkCallback registration
Test: new test in ConnectivityManagerTest
Bug: 20701525
Change-Id: I205333d31d43e6e6c7fe704ce63b458065f345ce
2017-03-02 15:19:37 +09:00
Erik Kline
47d8385184 Merge "Also test for additional NetworkCallback calls"
am: dff6c5c30d

Change-Id: I00b3f7be06bde167872d0cdefe940cda5e138846
2017-03-01 11:03:08 +00:00
Erik Kline
1d3db32708 Also test for additional NetworkCallback calls
Specifcally:
    - onCapabilitiesChanged
    - onLinkPropertiesChanged
    - onNetworkSuspended

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131

Change-Id: Ie0f7c8ac21313b11980bb335c89ecde6fd8e311c
2017-03-01 18:24:36 +09:00
Erik Kline
279a4feb72 Merge "Update UpstreamNetworkMonitor to use custom Handlers"
am: 35c89886c2

Change-Id: I76433822a9b7c124e4b7cfcf2a20cb0e43a60199
2017-02-24 08:15:19 +00:00
Erik Kline
b583b03675 Update UpstreamNetworkMonitor to use custom Handlers
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32130437
Bug: 32163131

Change-Id: I2bc3f87cdf7fa6392b4750eb8adb4ea33c6a3f43
2017-02-24 13:06:51 +09:00
Hugo Benichi
9355bce0c3 Merge "IP connectivity metrics: delete obsolete logger service" am: 37e3f22c2e am: c54962a4bd
am: 9c2b6afa2f

Change-Id: I5f8cd508812d9532778c2f1f019308a4b8d8ee33
2017-02-17 00:18:35 +00:00
Hugo Benichi
c54962a4bd Merge "IP connectivity metrics: delete obsolete logger service"
am: 37e3f22c2e

Change-Id: Ib335bc5e19c2c703d23267bf2835fc89fcf5a957
2017-02-17 00:00:14 +00:00
Hugo Benichi
37e3f22c2e Merge "IP connectivity metrics: delete obsolete logger service" 2017-02-16 23:52:13 +00:00
Hugo Benichi
d22edc28f5 IP connectivity metrics: delete obsolete logger service
Test: - runtest frameworks-net
      - manually verified $ adb shell dumpsys connmetrics
Bug: 32648597

Change-Id: I69f7dee5871508398d7f7209658a00c768e2d18e
2017-02-15 17:12:58 +09:00
Erik Kline
d850804723 Merge "Verify duplicate upstream notifications are ignored" am: 3d57eb0bdc am: 02e71f6245
am: 8055dafb08

Change-Id: I1e10adfba2ebb9f52e86d8b35f3d0b87134c0e91
2017-02-14 09:49:56 +00:00
Erik Kline
02e71f6245 Merge "Verify duplicate upstream notifications are ignored"
am: 3d57eb0bdc

Change-Id: Iff84a1a12714047b20408f03e3bb2252a463b74b
2017-02-14 09:41:53 +00:00
Erik Kline
624bf3d7f6 Verify duplicate upstream notifications are ignored
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest .../tethering/TetherInterfaceStateMachineTest.java passes
Bug: 32163131

Change-Id: I3c097d766fe4c416a8e3f02640809fe1199c6ef2
2017-02-14 15:55:57 +09:00
Erik Kline
ea7e8f7352 Merge "Cleanup in the face of upstream error" am: ed6d75d5f3 am: 76e6f790db
am: 663ec79cb2

Change-Id: Ib726fe85b816eccbc0beab555873b77f3454bc64
2017-02-14 06:25:47 +00:00
Erik Kline
76e6f790db Merge "Cleanup in the face of upstream error"
am: ed6d75d5f3

Change-Id: If8dbf882bd8c4a8d53ae026d8f83a00a52590830
2017-02-14 06:17:38 +00:00
Erik Kline
8ea45483fc Cleanup in the face of upstream error
If either enableNat() or startInterfaceForwarding() fail, be sure
to cleanup any commands that might have succeeded.

Most of this change is a refactoring of cleanupUpstreamIface() into
two methods, one of which (cleanupUpstreamInterface()) is reused
in error handling scenarios.

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest -x .../tethering/TetherInterfaceStateMachineTest.java passes
Bug: 32031803
Bug: 32163131

Change-Id: Ia4d56e03beeab1908d8b8c2202e94992f1aa58a4
2017-02-14 12:20:39 +09:00
Erik Kline
60d14c429b Merge "Add test coverage for cleanup bug to be fixed." am: 89e6bf0532 am: 0cca15ff88
am: 3de5971b40

Change-Id: I470c481a0eebc9cadf134c73ece08803927f4ca2
2017-02-13 12:08:11 +00:00
Erik Kline
0cca15ff88 Merge "Add test coverage for cleanup bug to be fixed."
am: 89e6bf0532

Change-Id: I33347c8fc2bec5660b8e9c14a316f6d14a6cf8b1
2017-02-13 11:57:37 +00:00
Erik Kline
a954be9563 Add test coverage for cleanup bug to be fixed.
The test calls that need to pass but do not currently are commented out.

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest -x .../tethering/TetherInterfaceStateMachineTest.java passes
Bug: 32031803
Bug: 32163131

Change-Id: I68ed476920bef882f353d8e8a54c72120bc27002
2017-02-13 17:38:34 +09:00
Erik Kline
c700509ade Merge "Add ConnectivityManager.networkCapabilitiesForType()" am: c313123afe am: 6f32aa0259
am: 7196e935a8

Change-Id: I2ab05143299f13012dc2a88efca52160e08c6d97
2017-02-02 07:32:09 +00:00
Erik Kline
6f32aa0259 Merge "Add ConnectivityManager.networkCapabilitiesForType()"
am: c313123afe

Change-Id: I0ad50fbf38f11b383fd889dc598cfddd47051477
2017-02-02 07:22:05 +00:00