Commit graph android_packages_modules_Co.../tests/net/java/com/android/server
Message SHA1
Merge "Skip unreachable route when estimating VPN destinations" am: e26fb9d574 am: fab8b096c3
am: dcdc2174af

Change-Id: Id81038035eddf98d0c4546ddb25c8f6ed5736ad6

Rubin Xu   authored and   android-build-merger   commited 2019-02-20 04:35:38 -08:00
e70e6ddd39
Merge "Skip unreachable route when estimating VPN destinations"
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-20 12:00:15 +00:00
e26fb9d574
Skip unreachable route when estimating VPN destinations
Bug: 122652441
Test: atest com.android.server.connectivity.VpnTest
Test: Establish a IPv4 VPN with minimal routes and check
(dumpsys connectivity) the VPN network does not have INTERNET
capability.

Change-Id: Ic7f19ebb7b7f78a6ffb2a8ec3fc3eca5e5421f57

Rubin Xu   commited 2019-02-19 17:18:34 +00:00
8b1352fdaa
Merge "Update VPN capabilities when its underlying network set is null." am: c7702baa80 am: 07fff8eb3c
am: 30714647b4

Change-Id: I6dd5a369f1a3b74bbf498051ef1e4d1b31bd8e5e

Varun Anand   authored and   android-build-merger   commited 2019-02-15 04:11:55 -08:00
bbefd325bc
Merge "Update VPN capabilities when its underlying network set is null."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-02-15 11:33:27 +00:00
c7702baa80
Merge "Move NetworkStack to services.net"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-02-15 10:52:03 +00:00
4616612b6b
Merge "Move NetworkStack to services.net"
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2019-02-15 07:25:09 +00:00
14aff42bdf
Move NetworkStack to services.net
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: Ib1d08a3669983640119d008db7e2990fa798724f
Merged-In: I501b125a388c1100c2182bde4670944c2f0d7a02

Remi NGUYEN VAN   commited 2019-02-15 12:20:17 +09:00
ef59a21ff4
Update VPN capabilities when its underlying network set is null.
Previously, they were only updated when underlying network set was
non-null.

This change also ensures that all the calls b/w ConnectivityService and
Vpn that leads to updating capabilities are on ConnectivityService
handler thread.

Additionally, it also ensures that capabilities are propagated after VPN
enters connected state. This was previously done from establish which
could potentially lead to race between VPN getting connected and
capabilities getting updated.

This change also updates VPN capabilities inline from
ConnectivityService handler thread. Previously, there was an additional
loop where Vpn would update capabilities via NetworkAgent thru
AsyncChannel which posts back to CS handler thread, which could
potentially lead to delays in updating VPN capabilities.

Bug: 119129310
Bug: 118856062
Bug: 124268198
Test: atest FrameworksNetTests
Test: manual - verified VPNs capabilities are getting updated and
DownloadManager is working correctly.

Change-Id: Id0abc4d304bb096e92479a118168690ccce634ed

Varun Anand   commited 2019-02-14 18:50:56 -08:00
df56995870
Move NetworkStack to services.net
NetworkStack is only used in services.net or clients of services.net. It
cannot stay in framework.jar because it needs to depend on AIDL
interfaces, which would conflict with app implementations if they were
in framework.jar.

(cherry-pick of aosp/905233 with trivial conflicts in SystemServer.java)

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I501b125a388c1100c2182bde4670944c2f0d7a02

Remi NGUYEN VAN   commited 2019-02-14 20:43:43 +09:00
b6997cc4da
Merge "Fix flaky testNattSocketKeepalives" am: 9a9e288607 am: ec2b289d42
am: 5dd6eb9d15

Change-Id: Ibfdd4dddb8dad9ee26f9f1ec175ca87bc46ce761

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-02-13 21:45:39 -08:00
c6b0f1a86b
Merge "Fix flaky testNattSocketKeepalives"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-02-14 03:29:00 +00:00
9a9e288607
Fix flaky testNattSocketKeepalives
The test did not wait for the WifiNetworkAgent to disconnect, and there
are reports of flakes where it is still connected in
connectKeepaliveNetwork.

Test: atest FrameworksNetTests
Bug: 124319553
Change-Id: I85968806885c8853ec4f4dbea356366c1af0ea1c

Remi NGUYEN VAN   commited 2019-02-14 03:28:48 +00:00
b76f9ee4e6
Merge "Remove hard-coded NetworkStack package name" am: 694dd4a5e2 am: e6fbb4664f
am: 43d71b08f5

Change-Id: Ic93c22e03a4ead4ec37b955993a32c8ce284e0a6

Remi NGUYEN VAN   authored and   android-build-merger   commited 2019-02-11 20:44:47 -08:00
a18c91cc73
Remove hard-coded NetworkStack package name
Have the network stack pass its package name in
showProvisioningNotification instead.

Bug: 124033493
Test: flashed, WiFi and captive portal works
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1f3312768ba1fb34e99a827e1fcdaf7510e318a8

Remi NGUYEN VAN   commited 2019-02-08 12:12:57 +09:00
794c7f2ee3
[KA02] internal cleanup and refactor for SocketKeepalive
In previous change, the new SocketKeepalive API was exported.
But internally, old PacketKeepalive names and structures are
still used.

This change rename them properly for code consistency and also
refactor KeepalivePacketData to support different types of
KeepalivePacketData.

Bug: 114151147
Test: 1. atest FrameworksNetTests
      2. atest FrameworksWifiTests
      3. atest FrameworksTelephonyTests

Change-Id: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e
Merged-In: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e

junyulai   authored and   Chalard Jean   commited 2019-02-05 20:13:47 +09:00
011b1f15c2
[KA02] internal cleanup and refactor for SocketKeepalive
In previous change, the new SocketKeepalive API was exported.
But internally, old PacketKeepalive names and structures are
still used.

This change rename them properly for code consistency and also
refactor KeepalivePacketData to support different types of
KeepalivePacketData.

(clean cherry-pick from aosp/860394)

Bug: 114151147
Test: 1. atest FrameworksNetTests
      2. atest FrameworksWifiTests
      3. atest FrameworksTelephonyTests

Change-Id: Ia9917d12987e91e87e34ffb3f126e7bc7c9c187e

junyulai   authored and   Chalard Jean   commited 2019-02-04 04:06:22 +00:00
1fb0c95661
Merge "Add an API that allows VPNs to declare themselves as metered." am: 35200a3b8a am: d4bdf28a26
am: ef0938774d

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037

Varun Anand   authored and   android-build-merger   commited 2019-01-30 20:11:09 -08:00
262381fcdc
Merge "Add an API that allows VPNs to declare themselves as metered."
Varun Anand   authored and   Gerrit Code Review   commited 2019-01-31 02:43:25 +00:00
35200a3b8a
Add an API that allows VPNs to declare themselves as metered.
For VPN apps targeting Q and above, they will by default be treated as
metered unless they override this setting before establishing VPN.

Bug: 120145746
Test: atest FrameworksNetTests
Test: On device tests verifying meteredness setup correctly for apps
targeting Q and apps targeting P.
Change-Id: Ia6d1f7ef244bc04ae2e28faa59625302b5994875

Varun Anand   commited 2019-01-30 14:09:03 -08:00
83759ee94b
Tell the factory it is already serving a request.
This is a cherry-pick of ag/607226 that has been rebased on
top of four years of changes and with comments addressed.

Gives each factory a serial number and propogates it to every
NetworkAgent so when a score comes back indicating a request is
being handled the factory can account for it properly.

Without this, a new request that's already handled by a network
offered by a factory will not cause an increment of the factorys
ref count. Concretely this results in issues like the RAT icon
not being displayed in spite of the network actually being up
and usable.

This will be ported to AOSP as soon as possible, but immediately
some master-only WiFi tests need to be adjusted with this change
which would not let me submit to AOSP.

Bug: 18637384
Bug: 29030667
Test: manual
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks-net
Test: atest CtsNetTestCases CtsHostsideNetworkTests
Change-Id: I597ac588f76dd507512ff02868fd1310b7e63f7e

Chalard Jean   commited 2019-01-30 15:41:57 +09:00
768ea1206d
Remove last NetworkStack usage of hidden APIs
Includes various small changes to stop using hidden APIs

Test: make NetworkStack
Test: flashed, booted, WiFi and tethering working
Bug: 112869080
Change-Id: Id2830795a444f484b377ed6437435a1cd833697a

Remi NGUYEN VAN   commited 2019-01-30 10:23:24 +09:00
6e82be4e4a
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Change-Id: I9119c139ab07a761ce5dfd1365b70eb905fd32dc

Pavel Grafov   commited 2019-01-25 19:59:03 +00:00
3aeb3f3455
Merge "Revert "Whitelist packages from VPN lockdown.""
Dan Albert   authored and   Gerrit Code Review   commited 2019-01-24 21:08:46 +00:00
7e81ae73b4
Revert "Whitelist packages from VPN lockdown."
This reverts commit f1a610a1c2.

Reason for revert: broke pi-dev-plus-aosp

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68

Dan Albert   commited 2019-01-24 21:05:39 +00:00
45f1a24661
Merge "Add API for proxy configuration over VPN."
Treehugger Robot   authored and   Gerrit Code Review   commited 2019-01-24 17:52:22 +00:00
b11e29d4b3
Merge "Whitelist packages from VPN lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-24 17:34:55 +00:00
bec7854508
Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
Merged-In: I7f6c5b9172063b588feacd6b9930a6cb88f764ab

Pavel Grafov   commited 2019-01-24 16:17:11 +00:00
f1a610a1c2
Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
Merged-In: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a

Irina Dumitrescu   commited 2019-01-24 16:07:20 +00:00
de132bb6d6
Merge "Popup a notification after logging in the captive portal network"
Lucas Lin   authored and   Gerrit Code Review   commited 2019-01-24 11:06:12 +00:00
01eeab4954
Popup a notification after logging in the captive portal network
Captive portal app will be auto dismissed after user login the
captive portal network. In order to improve the user experience,
popup a notification to notify user that the captive portal
network is connected.

Bug: 113629026
Test: 1.atest FrameworksNetTests:NetworkNotificationManagerTest
      2.Connect to a captive portal network and login, check if
      there is a notification popup.

Change-Id: Id54d12268e107af2f213c2bb348c5f7908e880f4

lucaslin   commited 2019-01-24 15:55:30 +08:00
b1e8e385dd
[KA05] Export keepalive offload api for IpSec Nat-T file descriptor
Adds system api of createSocketKeepalive to take file descriptor,
so privileged apps could use it without the need of IpSecService.

Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: If926c21704b6ed73a0adfcadad732b97b42bacae

junyulai   commited 2019-01-24 00:40:25 +08:00
d05a192fbe
[KA01] export SocketKeepalive API for NAT-T keepalive
The new set of API replace the PacketKeepalive system API
which is only specific for IPsec NAT-T keepalive packet. Allows
applications to request different types of keepalives through
the same set of API.

By using keepalives, applications could request system to
periodically send specific packets on their behalf, using
hardware offload to save battery power.

This change would only address interface change and test part of
original functionality. After all reference of PacketKeepalive
are removed, another change would be submitted to remove old
API.

Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: I3367666810acc44d5ad20e19acd4bf936e8b5d9c

junyulai   commited 2019-01-23 23:17:17 +08:00
4c95b08a23
Merge "Stop depending on the ConnectivityService default request."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2019-01-23 12:29:40 +00:00
bb5952107d
Stop depending on the ConnectivityService default request.
This avoids the need to expose ConnectivityService implementation
details as @SystemApi and the complexities that would be required
to make NetworkCapabilities parcelable in stable AIDL.

Bug: 112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Icd5d25b9b8e9b7a7d1899b000c92dc4976c3b3d7

Lorenzo Colitti   commited 2019-01-23 18:10:06 +09:00
0d1aaee1dd
Merge changes If71fadd2,I42047185
* changes:
  [MS10] Address leftover comments on MS03 and MS07
  [MS09] Implement isSameNetwork.

Chalard Jean   authored and   Gerrit Code Review   commited 2019-01-22 22:50:21 +00:00
2b428221cb
Merge "Add API for VPN apps to query always-on and lockdown."
Pavel Grafov   authored and   Gerrit Code Review   commited 2019-01-22 14:43:06 +00:00
5e135e2bdc
[MS09] Implement isSameNetwork.
Test: Old tests pass, new tests pass too.
Bug: 113554482

Change-Id: I420471853f3fab7725cba7ae500cebdce1912e43

Chalard Jean   commited 2019-01-22 19:10:48 +09:00
7f8be9f6ca
Merge "Add NetworkStack metrics to system API"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2019-01-22 07:48:39 +00:00
bda2c4fe17
Properly expect all callbacks in testStackedLinkProperties.
Currently testStackedLinkProperties accounts for some of the
NetworkCallbacks that are fired, but not all of them. The test
passes because it only ever expects LinkProperties changed
callbacks (and not, e.g., lost callbacks), because it uses
waitForIdle(), and because at the end, when the callback is
unregistered, it does not call assertNoCallback().

Add the missing callback expectation and expect a LOST callback
at the end. Also add an assertNoCallback, even though it's not
strictly necessary. Remove all the waitForIdle statements, which
are no longer necessary because every assertion happens after
waiting for a callback.

Making the expectations more precise in a separate CL will help
ensure that upcoming changes to this code don't break anything,
and will make said changes easier to review.

Bug: 65674744
Test: atest FrameworksNetTests
Test: ConnectivityServiceTest#testStackedLinkProperties passes 400 times
Change-Id: I73cda0dd029a0e6546f7272beedf841ce5a4c0dc

Lorenzo Colitti   commited 2019-01-22 10:53:00 +09:00
4433025623
Add NetworkStack metrics to system API
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ie52c55f248c173e2a5ee603ecd004fbac9004ac1

Remi NGUYEN VAN   commited 2019-01-21 23:24:41 +00:00
c8bf99d5d9
Add API for VPN apps to query always-on and lockdown.
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Bug: 72628179
Change-Id: I73cb0888f7049b12ab0cdfa62678c3846e074d3b

Pavel Grafov   commited 2019-01-21 13:48:45 +00:00
e87b7ceaa6
Merge "Avoid calling ParcelFileDescriptor.fromSocket on new Sockets."
Josh Gao   authored and   Gerrit Code Review   commited 2019-01-18 22:25:35 +00:00
5ceb563f51
[CS] Add an option to block sensitive network specifier
Network specifiers are used for 2 purposes:

- As part of network requests to specify more information on the type
  of requested networks.
- On network agents to specify information about their networks.

The network specifiers of the requests and agents are matched to each
other. However, the agent network specifier may contain sensitive
information which we do not want forwarded to any app.

This CL adds an option to strip out this agent network specifier before
the network capabilities are forwarded to the app.

Bug: 122160111
Test: atest ConnectivityServiceTest (frameworks/base/tests/net)
Test: atest frameworks/base/tests/net
Test: atest frameworks/opt/net/wifi/tests/wifitests
Test: atest frameworks/opt/telephony/tests/telephonytests
Test: atest frameworks/opt/net/ethernet/tests
Test: atest android.net.cts - some flakiness!
Test: act.py ThroughputTest
Test: act.py DataPathTest
Test: atest SingleDeviceTest (cts)
Change-Id: If08d312ff814bdde1147518f923199e6349503d5

Etan Cohen   commited 2019-01-17 16:30:05 -08:00
107ae95001
Delete the clatd functions from NetworkManagementService.
Make Nat464Xlat talk to netd directly instead of through
NetworkManagementService. The methods in NetworkmanagementService
don't really provide any value: since the only thing they do is
call into netd, we might as well have the callers talk to netd
directly,

In order to do this, pass INetworkManagementService and INetd to
the NetworkAgentInfo constructor, and update callers appropriately.

Bug: 65674744
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: Iac4cfe709c6279e4d9682b6754963e533707bd12

Lorenzo Colitti   commited 2019-01-15 11:13:07 +09:00
ae53ea1874
Move NetworkMonitor to NetworkStack
Bug: b/112869080
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1b8b6a3f4390adbabf92fb9e48da61c47b08b2ec

Remi NGUYEN VAN   commited 2019-01-11 09:59:11 +09:00
8539129ad9
Merge "Call netd to update the tcp buffer size"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-12-06 19:01:24 +00:00
a3713ac30d
Use ParcelFileDescriptor instead of FileDescriptor in INetd.aidl
Stable aidl won't support FileDescriptor but ParcelFileDescriptor.
In order to migrate to stable aidl, replace all FileDescriptor in
INdetd.aidl.

Test: runtest frameworks-net passes
Change-Id: Icdf37aed0e0cce0352070a437066e77c0f2fd85a

Luke Huang   commited 2018-11-28 13:41:58 +08:00
a904fab046
Call netd to update the tcp buffer size
The system server is controlling the tcp buffer now by writing to
/sys/kernel/ipv4/tcp_{rmem,wmem}_{min,def,max}. Those files are
basically the same as /proc/sys/net/ipv4/tcp_{rmem,wmem} except those
latter ones contain all three values in one file. Netd can directly write
to those files so we no longer need to depend on these android specific
files.

Test: netd_integration_test
Bug: 118572798
Change-Id: I588b48be29ecf61fd5bbf94f97f63738be4eae25

Chenbo Feng   commited 2018-11-27 15:37:52 -08:00
1541629a3f
Merge "PermissionMonitor: Move intent receiver to ConnectivityService."
Junyu Lai   authored and   Gerrit Code Review   commited 2018-11-27 01:48:59 +00:00
687cb5a0ed