Commit graph android_packages_modules_Co.../tests/net/java/com/android/server
Message SHA1
Merge changes from topic 'network_specifier' am: 78e38f292d am: 362bef45d1
am: cfd729093f

Change-Id: I7535495681da8f168c46d6d95e13925cffecc99b

Lorenzo Colitti   authored and   android-build-merger   commited 2017-04-12 22:58:42 +00:00
05a404cea0
Merge changes from topic 'network_specifier'
* changes:
  [CM] Unhide the NetworkSpecifier as object API
  Make the NetworkSpecifier a class instead of a string.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2017-04-12 22:27:37 +00:00
78e38f292d
Merge "Add an API hint for metered multipath traffic."
Treehugger Robot   authored and   Gerrit Code Review   commited 2017-04-10 05:40:10 +00:00
253efa0a14
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

Hugo Benichi   commited 2017-04-10 13:19:23 +09:00
98607d3f20
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 48a2a32bdd)

Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087

Lorenzo Colitti   commited 2017-04-06 16:50:06 +09:00
e454b43d3f
Make the NetworkSpecifier a class instead of a string.
Bug: 27533960
Bug: 36053921
Bug: 36275276
Test: connectivity, wifi, telephony unit tests
Change-Id: Idd9b10a8418c53c8cf386d9ff8252226b076bbf9

Etan Cohen   commited 2017-04-05 14:18:20 -07:00
8913454e36
Merge "Move back networking policy logic into NetworkPolicyManagerService" into oc-dev
am: 1173ec5bbb

Change-Id: I7d7b66cc1dc6888ea28e2b4d83d570fa440c29f2

Hugo Benichi   authored and   android-build-merger   commited 2017-04-04 00:58:02 +00:00
d51e308af3
Merge "Add test coverage for NetworkSpecifiers." am: 9ad085f55f am: 3145827105
am: 8ee38521bc

Change-Id: Ia7d36096f0e3f0b203d1d838043c03fcd1cea829

Lorenzo Colitti   authored and   android-build-merger   commited 2017-04-03 10:59:17 +00:00
a021753644
Merge "Add test coverage for NetworkSpecifiers."
am: 9ad085f55f

Change-Id: Ia328b945af4c4f55ef560b33b00fa861b8f81b0d

Lorenzo Colitti   authored and   android-build-merger   commited 2017-04-03 10:45:22 +00:00
3145827105
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

Lorenzo Colitti   commited 2017-04-03 17:46:35 +09:00
8af9dc0d91
Move back networking policy logic into NetworkPolicyManagerService
This patch removes from ConnectivityService the logic involved in
deciding if a uid has access to networking based on networking policies.

This logic is moved into NetworkPolicyManagerService which is the source
of truth with regards to the state of networking policie, both for
existing networks and uids.

Instead ConnectivityService directly queries NetworkPolicyManagerService
in a synchronous fashion for a specific uid or a (uid, network) pair.

This eliminates the need to keep a copy of the uid policy rules inside
ConnectivityService and ensures that ConnectivityService takes
networking decisions based on the correct state of networking policies,
and therefore eliminates certain data races in ConnectivityManager API
that applications are exposed to.

Test: $ runtest frameworks-net
      $ runtest -x frameworks/base/services/tests/../NetworkPolicyManagerServiceTest.java
      $ runtest -c com.android.server.net.ConnOnActivityStartTest frameworks-services
Bug: 32069544, 30919851
Change-Id: Ic75d4f7a8853e6be20e51262c4b59805ec35093a

Hugo Benichi   commited 2017-03-31 13:28:45 +09:00
396213651e
resolve merge conflicts of 943187668c44 to oc-dev-plus-aosp
Test: make -j30
Test: runtest -x tests/net/java/com/android/server/ConnectivityServiceTest.java
Test: runtest -x tests/net/java/com/android/server/connectivity/VpnTest.java
Change-Id: Ib87cdb96626cd7625e15bec5e4afab12920405e9

Robin Lee   commited 2017-03-30 17:39:56 +01:00
366eaa24ea
Merge "Move some VPN logic out of ConnectivityService"
am: a3cdab05a8

Change-Id: I212c2d6de1676ab65e6bbf34148d66e183d60c62

Robin Lee   authored and   android-build-merger   commited 2017-03-30 16:08:50 +00:00
f2e48204b6
Merge "Move some VPN logic out of ConnectivityService"
Robin Lee   authored and   Gerrit Code Review   commited 2017-03-30 16:00:41 +00:00
a3cdab05a8
resolve merge conflicts of 6c3cd4449517 to oc-dev-plus-aosp
Test: make -j64 framework services FrameworksNetTests
Change-Id: Ib828e56b271cd983ef325e366418ca8db9774628

Lorenzo Colitti   commited 2017-03-28 23:49:11 +09:00
db624146ac
Merge changes If94102c7,I8d51e8e0
am: 22b829c049

Change-Id: I8aa529a05fc40241ec9664775ca0ebd8960098a8

Lorenzo Colitti   authored and   android-build-merger   commited 2017-03-28 12:33:28 +00:00
fdad5b79a2
Make ConnectivityServiceTest pass on wifi-only devices.
Test: ConnectivityServiceTest passes on ryu on internal master
Test: ConnectivityServiceTest passes on bullhead
Change-Id: If94102c7df0257ea9e69e72b07a685ae3c2c4022

Lorenzo Colitti   commited 2017-03-28 12:53:06 +09:00
cd447b2cdc
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

Robin Lee   commited 2017-03-27 13:40:51 +01:00
984b5b6000
Merge "Fix NetworkNotificationManagerTest"
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-23 06:25:38 +00:00
a4213684a0
Fix NetworkNotificationManagerTest
The testNotificationsShownAndCleared test was not doing anything
because the list of notification to show was always empty.

This patch fixes this issue and actually makes the test loop on
non-empty collections, and also fixes another ordering issue in
assertions themselves, hidden until now by the first issue.

Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
Change-Id: I4837b1175d7c9133e9156e33acaa1e7e3341cc62

Hugo Benichi   commited 2017-03-23 12:32:27 +09:00
9eec272054
Connectivity metrics: add transports to validation probes
This patch adds transports info to ValidationProbeEvent and migrates
netId logging for this event to the topt-level netId field in
ConnectivityMetricsEvent.

Test: modified unit tests. $ runtest frameworks-net passes
Bug: 3490169
Change-Id: Ibf51049ba8901ae5ca4ea86e2f500944a4738b5c

Hugo Benichi   commited 2017-03-21 11:43:18 +09:00
7f818778a8
Connectivity metrics: change how interface names are logged
This patch deprecates the ifname field for specific metrics events of
types DhcpClientEvent, DhcpErrorEvent, IpReachabilityEvent and
IpManagerEvent.

Instead ifnames are logged in ConnectivityMetricsEvent, allowing for
link layer inference.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I8bfabcb115bbd5289471d653c153a40bb48f28cd

Hugo Benichi   commited 2017-03-21 10:18:56 +09:00
075cd83383
Connectivity metrics: serialize networkId, transports, ifname
This patch adds translation from ConnectivityMetricsEvent to
IpConnectivityEvent of recently added fields:
 - top-level network id
 - top-level ifname
 - transports

Also adds inference of link layer from transports or ifname.

At the moment these new fields are not populated in
ConnectivityMetricsEvent. Follow-up patches will fill this gap for
the events of the android.net.metrics package.

Test: new unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I563a6a3183470bdfaabb7c781a1beaf6b1058bf0

Hugo Benichi   commited 2017-03-21 10:18:11 +09:00
45f6ef836d
Merge "ConnectivityMetricsEvent: add ifname, netid, transports"
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-16 02:50:23 +00:00
2dbe719d4f
ConnectivityMetricsEvent: add ifname, netid, transports
This patch adds new fields to ConnectivityMetricsEvent to make it more
symmetric to IpConnectivityEvent in ipconnectivity.proto.

Follow-up patches will start populating these fields for users of
IpConnectivityLog.

Test: unit tests updated, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I396767cdfcf38cce893c0d6e1f4524f12e3fdc64

Hugo Benichi   commited 2017-03-16 09:58:02 +09:00
cf17909273
Merge "Connectivity metrics: simplify ConnectivityMetricsEvent"
Hugo Benichi   authored and   Android (Google) Code Review   commited 2017-03-16 00:37:47 +00:00
ffafc778f7
Connectivity metrics: simplify ConnectivityMetricsEvent
Now that ConnectivityMetricsEvent is only used for core networking
metrics and is not @SystemApi anymore, remove unused fields and prepare
for additional new fields.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I15abad19981d491f16f2a3afe401f1e833079907

Hugo Benichi   commited 2017-03-15 15:12:38 +09:00
4953ce3d15
Merge "IP connectivity metrics: add new APF counters."
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-15 04:24:30 +00:00
d393e0233d
IP connectivity metrics: add new APF counters.
This patch adds a few missing counters to APF events:
 - an actual lifetime duration to ApfProgramEvent.
 - counters for total number of updates to ApfStatistics.

ApfProgramEvents are now recorded at program removal in order to
populate the actual lifetime of the program. ApfProgramEvents whose
actual lifetime was less than 1 second are filtered out.

Finally, instance fields of ApfProgramEvent and ApfStats classes are
made mutable to allow for simple record-like creation. This was not
possible when these classes were tagged @SystemApi.

Test: - manually verified output of $ dumpsys connmetrics list
      - unit tests updated.
Bug: 34901696

Change-Id: I02694ebb9421ce1c2aa757fa6aa209d19a654dcd

Hugo Benichi   commited 2017-03-15 11:49:48 +09:00
c012c253c2
IP connectivity metrics: ConnectStats additions
This patch:
  - adds a counter to ConnectStats for counting the number of successful
    connect() calls done in blocking mode. This allows to compute error
    rates for connect() in blocking mode.
  - add printing of ConnectStats when dumping NetdEventListenerService
    and/or IpConnectivityMetrics service.

Test: $ runtest frameworks-net, + manual tests verifying logged events.
Bug: 34901696
Change-Id: I889e8ccd12681b0511be487e9d2ee44290a2d7d7

Hugo Benichi   commited 2017-03-13 09:25:15 +09:00
8f3131cbcd
IP connectivity metrics: update ipconnectivity.proto
This patch adds several new fields to ipconnectivity.proto for
improving APF metrics, connect metrics, and link_layer inference.

Test: build, flashed, ran $ adb shell dumpsys connmetrics list proto
      updated metrics unit tests depending on proto schema
Bug: 34901696
Change-Id: I6f68e16f583a6b407f33f8a500133e100f3453c7

Hugo Benichi   commited 2017-03-09 15:19:02 +09:00
2de8920989
Merge "request{LinkProperties,NetworkCapabilities} no longer needed" am: 67a9265809 am: 57c8c6b5f4
am: bb54baba04

Change-Id: Id2aa8aeff6d299edb85955c12ab0a04023458597

Erik Kline   authored and   android-build-merger   commited 2017-03-07 13:42:11 +00:00
2b1df53310
Merge "request{LinkProperties,NetworkCapabilities} no longer needed"
am: 67a9265809

Change-Id: I79b9323be242ed5d2bf83962f78c613a465a20b8

Erik Kline   authored and   android-build-merger   commited 2017-03-07 13:33:29 +00:00
57c8c6b5f4
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

Erik Kline   commited 2017-03-07 17:18:06 +09:00
26af1d81b3
Merge "Always send all available state when calling onAvailable()." am: 8fdbb6d6e2 am: b90963fe4d
am: 3765538bab

Change-Id: Ic82e3cb92841ea99972faad6ae004d77c725831b

Erik Kline   authored and   android-build-merger   commited 2017-03-07 06:08:40 +00:00
0fd4b155a5
Merge "Always send all available state when calling onAvailable()."
am: 8fdbb6d6e2

Change-Id: I81e70fecf060a4103b51084a60a32c78f6219f6b

Erik Kline   authored and   android-build-merger   commited 2017-03-07 06:00:09 +00:00
b90963fe4d
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

Erik Kline   commited 2017-03-07 12:57:26 +09:00
99f301bdfd
Merge "Also test for additional NetworkCallback calls" am: dff6c5c30d am: 6978b2427c
am: 02310829cf

Change-Id: I0264a471312423e896a1c2f479c0eeda737a1567

Erik Kline   authored and   android-build-merger   commited 2017-03-01 11:13:14 +00:00
37bb686bb7
Merge "Also test for additional NetworkCallback calls"
am: dff6c5c30d

Change-Id: I00b3f7be06bde167872d0cdefe940cda5e138846

Erik Kline   authored and   android-build-merger   commited 2017-03-01 11:03:08 +00:00
6978b2427c
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

Erik Kline   commited 2017-03-01 18:24:36 +09:00
4f89af67b2
IP connectivity metrics: cleanup obsolete code
This patch cleans obsolete code related to IP connectivity metrics:
 - remove @SystemApi on android.net.metrics: now that metrics events
   are processed and serialized in the frameworks only, event classes
   should not appear in the system apis.
 - remove obsolete Logger classes: ConnectivityMetrics app was the
   unique user of ConnectivityMetricsLogger until nyc-mr1. From nyc-mr1
   the app started using dumpsys to get metrics for IpConnectivity and
   Telephony, which made ConnectivityMetricsLogger obsolete.
 - simplifications in MetricsTestUtil

Test: - runtest frameworks-net
      - manually verified $ adb shell dumpsys connmetrics
Bug: 30054585
Bug: 32648597
Change-Id: I85ef65f7f69eb9299e4636cc7af54067201d9daf

Hugo Benichi   commited 2017-02-22 12:56:38 +09:00
f3fe279f50
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.

Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087

Lorenzo Colitti   commited 2017-02-01 17:02:29 +09:00
48a2a32bdd
ConnectivityServiceTest: remove remaining poll loops. am: aebc0598b9 am: 5f807b3b74 am: 87eab8e1c4
am: 4f71ef3f5d

Change-Id: Idc5d60f9ed5fbbb39256b9983a5b292a0302b2f1

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:18:46 +00:00
38aa28e2ad
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker am: ee6c69ecc4 am: 49040a3d5a am: 5bbbf841eb
am: 016e4f3a23

Change-Id: I5aefc453c022286e6ee2332a53e6c9f36472e9a5

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:17:19 +00:00
2f8d8640f9
Attempt to make waitForIdleHandler reliable. am: 572f1a3185 am: b18bd6bd3d am: e160fe177d
am: 3c3eddc7ae

Change-Id: Ia2d7a4405ce60ca99b1ee6c80c0babf93983cf64

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:16:18 +00:00
b79102b25e
ConnectivityServiceTest: remove remaining poll loops. am: aebc0598b9 am: 5f807b3b74
am: 87eab8e1c4

Change-Id: I31681e1248721704a9b792962a2ef5955e375e93

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:01:52 +00:00
4f71ef3f5d
Remove assertEventuallyTrue as it's unnecessary. am: 4b07a883ca am: c939693265
am: c2279a09bf

Change-Id: Ib16f54aeaa783a6e26a9d80e61388cbd9ecd9bd3

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:00:41 +00:00
8183372be8
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker am: ee6c69ecc4 am: 49040a3d5a
am: 5bbbf841eb

Change-Id: I91f1338f3488cfc60eef0c2147aa7b1d61107cdd

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:59:42 +00:00
016e4f3a23
Attempt to make waitForIdleHandler reliable. am: 572f1a3185 am: b18bd6bd3d
am: e160fe177d

Change-Id: I2369fbd693b467283232f47703fd471c8ff60c1f

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:58:24 +00:00
3c3eddc7ae
ConnectivityServiceTest: remove remaining poll loops.
am: aebc0598b9

Change-Id: I675096683c8ed4bc0e540491c0ff6aa828114313

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:39:30 +00:00
5f807b3b74