Commit Graph

4754 Commits

Author SHA1 Message Date
Benedict Wong
c3153bd028 Merge "Add checks to ensure SPIs are not reused" am: e9f609ee76 am: 567ecd6790
am: 7c66896fa8

Change-Id: I13738ac37710ec7934998ef269681ae7c41c612e
2018-01-23 20:40:39 +00:00
Lorenzo Colitti
1e7d634a10 Merge changes from topic "multipath-datausage-backport" am: ae0d925470 am: 50f296dec7
am: fb1afacbf1  -s ours

Change-Id: Ib16c50de2a3846dae9736e7ca68a4282831f0812
2018-01-23 20:20:53 +00:00
Lorenzo Colitti
f989f097f7 Disable IpConnectivityMetricsTest. am: c4ba57cadd am: 71472bea68
am: b74b04b1b3  -s ours

Change-Id: Ie9b63bf66eee676568e7262350033dbb286c04c4
2018-01-23 20:10:13 +00:00
Benedict Wong
7c66896fa8 Merge "Add checks to ensure SPIs are not reused" am: e9f609ee76
am: 567ecd6790

Change-Id: I8c7243bc600e5f2e9abec03b5a357ed6376aa9bf
2018-01-23 19:55:47 +00:00
Lorenzo Colitti
fb1afacbf1 Merge changes from topic "multipath-datausage-backport" am: ae0d925470
am: 50f296dec7

Change-Id: I45f0c69e3440e9ec69c82e81c41bea682a359389
2018-01-23 19:43:13 +00:00
Lorenzo Colitti
b74b04b1b3 Disable IpConnectivityMetricsTest. am: c4ba57cadd
am: 71472bea68

Change-Id: Ic5a24e40ce126bc872281bb353706a245eb345f2
2018-01-23 19:33:27 +00:00
Benedict Wong
567ecd6790 Merge "Add checks to ensure SPIs are not reused"
am: e9f609ee76

Change-Id: I893925014557e5ae13303debc4ee8f50faf9605d
2018-01-23 19:27:51 +00:00
Lorenzo Colitti
50f296dec7 Merge changes from topic "multipath-datausage-backport"
am: ae0d925470

Change-Id: Ic29d71ade161434b6dea796a887f60b5587ca1d5
2018-01-23 19:17:54 +00:00
Lorenzo Colitti
71472bea68 Disable IpConnectivityMetricsTest.
am: c4ba57cadd

Change-Id: Iba9dad4001c6aa725285eee6df32f116c846532d
2018-01-23 19:04:05 +00:00
Benedict Wong
e9f609ee76 Merge "Add checks to ensure SPIs are not reused" 2018-01-23 18:00:06 +00:00
Lorenzo Colitti
ae0d925470 Merge changes from topic "multipath-datausage-backport"
* changes:
  Support passing a template to NetworkStatsManager queries.
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.
  Disable IpConnectivityMetricsTest.
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-23 15:22:18 +00:00
Ricky Wai
5f094094d9 Merge "Add ConnectivityManager.getNetworkWatchlistConfigHash()" 2018-01-23 14:25:39 +00:00
Chalard Jean
fd3a4ae0fe Let network requests see VPNs.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3b16caad7787c3c1f2921ca1583815c89efbadc5
2018-01-23 21:38:00 +09:00
Chalard Jean
3a6b34c989 Move constants into a new file.
Also audit all constants, make some private, annotate some
with @VisibleForTesting.

Test: runtest framework && cts
Change-Id: Iaf5ea7abd36fd8d544dcc84654f6cb529196d654
2018-01-23 21:38:00 +09:00
Chalard Jean
b399bf16d1 Make sure listen requests from VPN apps see their own networks
Test: runtest frameworks-net
Test: CTS pass, including with the next patch which is what this
      actually matters for

Change-Id: I09a94042acbefa24ab884f95326e30d6ab280b82
2018-01-23 21:38:00 +09:00
Chalard Jean
92a116d264 Add a test for new UID checking code.
Test: manual, this is a new test and it passes
Change-Id: I69a39039647ec05f970700e36c5f1e1e6e110f4a
2018-01-23 21:38:00 +09:00
Chalard Jean
b2a4991781 Remove UID_RANGES_ADDED and REMOVED.
Test: runtest frameworks-net
Test: also tested with VPN app
Test: also cts passing
Change-Id: I3530030996daeba05a8f2fffc5c6e21ed62e3f40
2018-01-23 21:38:00 +09:00
Chalard Jean
753d9734d2 Move VPN allowed UIDs into NetworkCapabilities.
Test: runtest frameworks-net
Test: also new specific tests for this new code
Test: also tested with VPN app
Test: also cts passing
Change-Id: If0311bae2bf99dedac959febadecf4f92f3064b8
2018-01-23 21:38:00 +09:00
Chalard Jean
cbe99b35a0 Pre-import to remove a conflict.
Test: compiles and passes checkstyle
Change-Id: I1ffdd88e6268fee0cf88992420ab21eb42928957
2018-01-23 21:38:00 +09:00
Lorenzo Colitti
c4ba57cadd Disable IpConnectivityMetricsTest.
This test has been failing for a while, and we are do not have
bandwidth to fix it during the next week.

Test: make -j64 FrameworksNetTests RUN_ERROR_PRONE=true
Test: atest FrameworksNetTests:IpConnectivityMetricsTest
Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
Change-Id: I59d73c1773e160a726996f3ab4ad20312decc127
Merged-In: I59d73c1773e160a726996f3ab4ad20312decc127
2018-01-23 18:38:48 +09:00
Chenbo Feng
b25ada3657 Use /proc/net/dev to get stats summary
If the qtaguid proc file is no longer exist, the device is running new
eBPF module to do traffic accounting. So the NetworkStatsFactory need to
use the proc/net/dev interface to get the per interface traffic stats
summary. Also, adding a test to verify the helper function work properly

Bug: 30950746
Test: run NetworkStatsFactoryTest
Change-Id: Ia36808bf02f1637dd41a3e7c50917b91b1a77524
2018-01-23 00:35:02 -08:00
Chenbo Feng
7224ab835a Add bpf support for NetworkStatsFactory
Add the native method used to read the detail information of network
stats from bpf maps. The native method of NetworkStatsFactory should
choose the correct implementation to get the stats detail depending on
the kernel version. Currently the bpf result is printed as a reference
and the actual behavior of NetworkStatsFactory should not change.

Test: NetworkStatsFactory related cts test should not fail.
Bug: 30950746
Change-Id: I4715a23559b5b2306bd556cea0431f0ed172a993
2018-01-23 00:34:53 -08:00
Ricky Wai
7097cc9319 Add ConnectivityManager.getNetworkWatchlistConfigHash()
Apps can use this API to get network watchlist config hash for auditing.

Bug: 63908748
Test: Able to compile
Change-Id: I5ce9e6bb6dad88139c0a102da58be0dd7c284b7a
2018-01-23 06:32:36 +00:00
Benedict Wong
bb31e20bcd Add checks to ensure SPIs are not reused
This change adds an additional check in CheckIpsecConfig to prevent
users from using the same SPI twice. This allows for a more granular
error message.

Bug: 70642141
Test: Tests added in IpSecServiceParameterizedTest
Change-Id: I9621fb05c6b162bd8ae8db4ac1e64feaa9d0ac73
2018-01-22 21:09:47 -08:00
Benedict Wong
22087fd1c3 Merge "Address comments and final cleanup from refcounting integration" am: 3dcee3120b am: 9b1dfec3de
am: 36efbd03c2

Change-Id: I0612286b8d95b0ae10c1337214f9c3b4e570fbac
2018-01-23 00:19:05 +00:00
Benedict Wong
36efbd03c2 Merge "Address comments and final cleanup from refcounting integration" am: 3dcee3120b
am: 9b1dfec3de

Change-Id: I7ed4a6bb90f3cf3ed5fd0e6ad20b033e588a4c90
2018-01-23 00:08:17 +00:00
Benedict Wong
9b1dfec3de Merge "Address comments and final cleanup from refcounting integration"
am: 3dcee3120b

Change-Id: Ie0bc2b81e09ee874ef848905bb486967a857c6d1
2018-01-22 23:57:28 +00:00
Benedict Wong
3dcee3120b Merge "Address comments and final cleanup from refcounting integration" 2018-01-22 20:32:18 +00:00
Benedict Wong
c3d749e0a5 Merge "Rename create/delete transform methods" am: 77883ceedc am: 2af9354354
am: 2ec160eb05

Change-Id: Ie07b0b608b3dfcbfc4228a15e26fe6f6559315f9
2018-01-22 20:03:48 +00:00
Benedict Wong
2ec160eb05 Merge "Rename create/delete transform methods" am: 77883ceedc
am: 2af9354354

Change-Id: I16bfb511ac2d6094e246f79d51fe4520d3e765cd
2018-01-22 19:53:15 +00:00
Benedict Wong
2af9354354 Merge "Rename create/delete transform methods"
am: 77883ceedc

Change-Id: I76576d1f3193fcbb3680fb29893cf696ea7a41fe
2018-01-22 19:44:43 +00:00
Benedict Wong
77883ceedc Merge "Rename create/delete transform methods" 2018-01-22 17:57:15 +00:00
Lorenzo Colitti
d6aa30a780 Disable IpConnectivityMetricsTest.
This test has been failing for a while, and we are do not have
bandwidth to fix it during the next week.

Test: make -j64 FrameworksNetTests RUN_ERROR_PRONE=true
Test: atest FrameworksNetTests:IpConnectivityMetricsTest
Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
Change-Id: I59d73c1773e160a726996f3ab4ad20312decc127
2018-01-22 21:41:20 +09:00
Benedict Wong
01e9f19d7b Rename create/delete transform methods
CreateTransportModeTransform and DeleteTransportModeTransform are both
agnostic as far as which mode of transform it creates/deletes. As such,
to facilitate the implementation of tunnel mode, this patch renames them
to CreateTransform and DeleteTransform, along with all test names.

Bug: 63588681
Test: frameworks/base unit tests and CTS tests run, passed
Change-Id: I1f015eb7ad0e85fca966658a9402485ca2b44091
2018-01-19 10:43:01 -08:00
Lorenzo Colitti
e31ae2650d Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: 5087f93c36 am: 69a42fa9c5
am: 6eb22572ce

Change-Id: I12108d96e29bfe71406106c2af950a6d6a9f8351
2018-01-19 16:46:11 +00:00
Lorenzo Colitti
6eb22572ce Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: 5087f93c36
am: 69a42fa9c5

Change-Id: I1ac9d349850d607c5fbf4a47760bc09de1c18043
2018-01-19 16:37:44 +00:00
Lorenzo Colitti
69a42fa9c5 Merge changes Id8776d14,Ifa291c62,I5ea9d200
am: 5087f93c36

Change-Id: I7a0b01cba8bdee67cffabddacb4ff5f4591cbc34
2018-01-19 16:30:17 +00:00
Treehugger Robot
5087f93c36 Merge changes Id8776d14,Ifa291c62,I5ea9d200
* changes:
  Track and persist in stats whether traffic is on the default network.
  Add the default network to NetworkStats and NetworkStatsCollection.
  Pass all default networks to NetworkStatsService
2018-01-19 14:48:52 +00:00
Lorenzo Colitti
9d93e1a453 Track and persist in stats whether traffic is on the default network.
This change adds the defaultNetwork to the ident based on current
system networking state, and persists that value to flash.

Bug: 35142602
Test: runtest frameworks-net
Test: downloaded files using default/non-default networks while watching dumpsys netstats
Change-Id: Id8776d149b2977548a9eb455ad4926af55e25aba
2018-01-19 19:49:16 +09:00
Lorenzo Colitti
cd969ef97c Add the default network to NetworkStats and NetworkStatsCollection.
This allows us to maintain NetworkStats entries that track
whether the traffic was on the default network.

At the moment, the stats collection code always passes in
DEFAULT_NETWORK_NO. However, this value is a no-op, since it is
not persisted to disk. Only the ident, the uid/set/tag, and the
packet/byte/operation counters are persisted.

A future change will add defaultNetwork to the ident and start
persisting it.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: Ifa291c62c0fa389b88e5561086a29dcd7cee2253
2018-01-19 19:49:16 +09:00
Lorenzo Colitti
2486188d7b Pass all default networks to NetworkStatsService
This will allow NetworkStatsService to treat traffic on these
networks differently from traffic where the app selects a network
that is not the default.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: I5ea9d200d9fb153490c6108bb9390bf152f297da
2018-01-19 16:40:10 +09:00
Jeff Sharkey
658ca09f5e Merge "Add ability to override subscriber capabilities." am: d6cd4b241a am: d358b0d1ea
am: 59f824c977

Change-Id: I46a6c87751494afca6fdd13736d7a4877e3cc833
2018-01-19 05:25:20 +00:00
Jeff Sharkey
59f824c977 Merge "Add ability to override subscriber capabilities." am: d6cd4b241a
am: d358b0d1ea

Change-Id: Ib22d57c7cde75560cfd5bdd71b75d29b1056f783
2018-01-19 01:11:41 +00:00
Jeff Sharkey
d358b0d1ea Merge "Add ability to override subscriber capabilities."
am: d6cd4b241a

Change-Id: Id035d437e9b297ba70ba9231f6cfdd44e5b9c257
2018-01-19 01:04:32 +00:00
Di Lu
fcf78b1727 Add xfrm mark in IpSecConfig
Bug: 63589600
Test: runtest frameworks-net
Change-Id: I2d38d781b8b31d8bf39fd4e9a7e31509f15a9e16
2018-01-18 15:23:56 -08:00
Jeff Sharkey
0f2738ecb0 Add ability to override subscriber capabilities.
In a future set of CLs, NPMS will offer to override a handful of
capabilities on a per-subId basis.  Define a no-op version of the
interface to make it easier to add new methods in the future.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.
Test: bit FrameworksTelephonyTests:com.android.internal.telephony.dataconnection.DataConnectionTest
Bug: 64133169
Change-Id: I03dfd98463861f0338c4174e8d8a88c300ea5b55
2018-01-18 14:46:13 -07:00
Jeff Sharkey
d86a06f7b4 Merge "Add "not congested" network capability." am: 8a06cca651 am: 944a9864a2
am: f22a540007

Change-Id: I836fedeab34f34a43e0257e395fca1f735bc6d61
2018-01-18 04:20:44 +00:00
Erik Kline
6ac4ac703b Merge "Add basic resolution of Private DNS hostname" am: 5c2380b0d2 am: 5d10f67617
am: 4d75779d8d

Change-Id: Iacdad88b49aff3e34afc93acfb8d3eeca9745c43
2018-01-18 04:10:12 +00:00
Jeff Sharkey
f22a540007 Merge "Add "not congested" network capability." am: 8a06cca651
am: 944a9864a2

Change-Id: I2c7276bd657f5805c0b6492a216435270023a3c6
2018-01-18 04:10:00 +00:00
Erik Kline
4d75779d8d Merge "Add basic resolution of Private DNS hostname" am: 5c2380b0d2
am: 5d10f67617

Change-Id: Ifc776c67025925fbeb2c13038ae78061c32567f5
2018-01-18 04:02:46 +00:00