Commit Graph

1424 Commits

Author SHA1 Message Date
Etan Cohen
272ed7536e Merge "[CS] Support "instant failure" from factories" 2019-02-22 14:29:39 +00:00
Rubin Xu
391f42b70d Merge "Skip unreachable route when estimating VPN destinations" am: 21078b1edd am: e000de90f4
am: 12d2de6417

Change-Id: Id81038035eddf98d0c4546ddb25c8f6ed5736ad6
2019-02-20 04:35:38 -08:00
Treehugger Robot
21078b1edd Merge "Skip unreachable route when estimating VPN destinations" 2019-02-20 12:00:15 +00:00
Rubin Xu
c63e48dd65 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
2019-02-19 17:18:34 +00:00
Varun Anand
9164fbec93 Merge "Update VPN capabilities when its underlying network set is null." am: e3ae238f4a am: d6d593572e
am: d5444c9eb6

Change-Id: I6dd5a369f1a3b74bbf498051ef1e4d1b31bd8e5e
2019-02-15 04:11:55 -08:00
Treehugger Robot
e3ae238f4a Merge "Update VPN capabilities when its underlying network set is null." 2019-02-15 11:33:27 +00:00
Remi NGUYEN VAN
762f9f0c24 Merge "Move NetworkStack to services.net" 2019-02-15 10:52:03 +00:00
Remi NGUYEN VAN
584b1378a8 Merge "Move NetworkStack to services.net" 2019-02-15 07:25:09 +00:00
Remi NGUYEN VAN
5db454c28d 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
2019-02-15 12:20:17 +09:00
Varun Anand
4fa80e8a2f 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
2019-02-14 18:50:56 -08:00
Remi NGUYEN VAN
310da6f0e8 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
2019-02-14 20:43:43 +09:00
Remi NGUYEN VAN
d085587d7c Merge "Fix flaky testNattSocketKeepalives" am: 16758070d0 am: def37aef89
am: 0ed6920494

Change-Id: Ibfdd4dddb8dad9ee26f9f1ec175ca87bc46ce761
2019-02-13 21:45:39 -08:00
Remi NGUYEN VAN
16758070d0 Merge "Fix flaky testNattSocketKeepalives" 2019-02-14 03:29:00 +00:00
Remi NGUYEN VAN
ac02bc8141 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
2019-02-14 03:28:48 +00:00
Etan Cohen
ae574a8673 [CS] Support "instant failure" from factories
Add a mechanism by which a factory can declare "instant failure" for
a request - which would result in it getting an OnUnavailable()
(even without a timeout).

Factories may only do this iff:
1. They know they are the only factory which may fulfill this
   request (common for transport-specific requests).
2. The know that the request can definitely not be
   fulfilled at any point in the future.

Bug: 31382922
Test: atest ConnectivityServiceTest
Change-Id: I9bce0f4d85fa8cad7f8a9998819f945b778c5ac5
2019-02-13 08:44:51 -08:00
Mark Chien
8fee3dee71 Merge "Support multi-SIM entitlement check" 2019-02-13 02:29:01 +00:00
markchien
0b5950781d Support multi-SIM entitlement check
1. Trigger entitlement recheck when perferred SIM switch.
2. Get resources from preferred SIM's subId to build
   TetheringConfiguration.

Bug: 120069528
Bug: 122108346
Test: -atest FrameworksNetTests
      -build, flash, booted
      -manual hotspot hotspot with DSDS switch

Change-Id: Icbfa8e84d675c95c0c5563087490ca8e36d91b73
Merged-in: Icbfa8e84d675c95c0c5563087490ca8e36d91b73
2019-02-12 08:20:27 +00:00
Mark Chien
4f7ff38376 Merge "Support multi-SIM entitlement check" 2019-02-12 08:05:11 +00:00
Remi NGUYEN VAN
638601c47d Merge "Remove hard-coded NetworkStack package name" am: e765e8b7aa am: d49230d8df
am: a6391b14d2

Change-Id: Ic93c22e03a4ead4ec37b955993a32c8ce284e0a6
2019-02-11 20:44:47 -08:00
Remi NGUYEN VAN
9c5d964902 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
2019-02-08 12:12:57 +09:00
Chalard Jean
de626e0520 Merge "[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData" am: 533b2960fc am: 968c9f495c
am: 66b84e3c44

Change-Id: I700550160c795becb4c3e37a88328488846d272f
2019-02-06 01:47:49 -08:00
Chalard Jean
f431962460 Merge "[KA03] Support tcp keepalive offload" am: 5f8ddc2eb1 am: 6bbaced544
am: 9eb8724be7

Change-Id: I55d7b285a75946713986163fbaa166d4b02513d4
2019-02-05 22:41:37 -08:00
junyulai
2ed5d4cf92 [KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData
Bug: 114151147
Test: atest FrameworksNetTests
Change-Id: I057dde79013b9eda5037b9a44f8eee06cc07352e
2019-02-06 14:07:39 +09:00
markchien
150e191bca [KA03] Support tcp keepalive offload
When offload is starting, socket will be switched to repair
mode. Read and write on the socket will not be allowed until
repair mode is turned off. If remote packet arrives, repair
mode will be turned off automatically and a callback will
be raised to indicate that socket is ready to read from.

Bug: 114151147
Test: -atest FrameworksNetTests
      -manual

Change-Id: I0c335865912e183e7ad32a8ea12188f02ccde5fd
2019-02-06 12:22:22 +09:00
junyulai
06835112ab [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
2019-02-05 20:13:47 +09:00
markchien
293422f1d0 Support multi-SIM entitlement check
1. Trigger entitlement recheck when perferred SIM switch.
2. Get resources from preferred SIM's subId to build
   TetheringConfiguration.

Bug: 120069528
Bug: 122108346
Test: -atest FrameworksNetTests
      -build, flash, booted
      -manual hotspot hotspot with DSDS switch

Change-Id: Icbfa8e84d675c95c0c5563087490ca8e36d91b73
2019-02-04 18:53:57 +08:00
junyulai
e413528700 [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
2019-02-04 04:06:22 +00:00
Mark Chien
c85d681cec Merge "Add get last entitlement value callback API" am: 4163ff7928 am: 524fbd619e
am: a31f85f6dc

Change-Id: If67c8d092dd2c40f95cbe423bc694aa349039541
2019-01-30 23:59:01 -08:00
Mark Chien
4163ff7928 Merge "Add get last entitlement value callback API" 2019-01-31 07:23:31 +00:00
markchien
f273127880 Add get last entitlement value callback API
The callback would be used to notify entitlement value. If the
cache value indicates entitlement succeeded, it just fire
callback with cache value instead of run entitlement check.

Bug: 120887283
Test: atest FrameworksNetTests
Change-Id: I8afe928423bd75c54c61533a50a5c0814922ceb1
2019-01-31 12:31:55 +08:00
Varun Anand
066e326222 Merge "Add an API that allows VPNs to declare themselves as metered." am: 62a9b66a38 am: 9563c15d09
am: b8ae5b64a9

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037
2019-01-30 20:11:09 -08:00
Varun Anand
62a9b66a38 Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Varun Anand
1215f09b07 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
2019-01-30 14:09:03 -08:00
Chalard Jean
08577fc579 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
2019-01-30 15:41:57 +09:00
Remi NGUYEN VAN
4a80077ddd Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c am: 4845df3ced
am: 14062be8f2

Change-Id: I2059d9cfa3015388301a74828255354b6dc23c23
2019-01-29 21:42:29 -08:00
Remi NGUYEN VAN
231b52bc03 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
2019-01-30 10:23:24 +09:00
Pavel Grafov
1f47ab08c1 Merge "Whitelist packages from VPN lockdown." am: 774c3ce152 am: b478bb25ac
am: 2b996ad0dd

Change-Id: Ice1f8f27da3d0092af58c8e93969575ba9f8f925
2019-01-28 22:13:24 -08:00
Pavel Grafov
774c3ce152 Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
b8bbc48dee Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
18f11cd4d7 Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 06:57:25 +00:00
Remi NGUYEN VAN
77dd54d3d4 Move NetworkUtils used by NetworkStack
Depending on usage move into NetworkStackUtils or shared
Inet4AddressUtils.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
(Cherry-pick of aosp/881952)
Change-Id: Ie20dcee375b377236004a7689890729493aca857
2019-01-28 13:45:46 +09:00
Remi NGUYEN VAN
e88516f13b Move NetworkUtils used by NetworkStack
Depending on usage move into NetworkStackUtils or shared
Inet4AddressUtils.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Merged-In: Ie20dcee375b377236004a7689890729493aca857
Change-Id: Ib8d000529872796022706a35050fdc2c7141f2ab
2019-01-28 13:45:17 +09:00
Remi NGUYEN VAN
a4bcc86dbe Add NetworkStack networking deps to SystemApi
Cherry-pick with conflicts fixed in CaptivePortalLoginActivity imports.
Test: atest FrameworksNetTests
Bug: 112869080
Merged-In: Id59dc06fb85e4ac88098f56b621ec880610759ce
Change-Id: I3c05e8fdd70497426d4fa433295c4fbdad07d9c9
2019-01-28 13:28:35 +09:00
Lorenzo Colitti
9b634f17a2 Merge "Add NetworkStack networking deps to SystemApi" 2019-01-28 02:58:01 +00:00
Pavel Grafov
a462bcb9c4 Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Change-Id: I9119c139ab07a761ce5dfd1365b70eb905fd32dc
2019-01-25 19:59:03 +00:00
Chalard Jean
91dce9c9c7 Merge "Fix IPMS tests timeout." am: 1f9d80f6ee am: 618ff5185a
am: d7bb3192af

Change-Id: I3c27bb789b8c44d6e2c46dabe65bf19452453257
2019-01-24 16:55:28 -08:00
Treehugger Robot
1f9d80f6ee Merge "Fix IPMS tests timeout." 2019-01-25 00:15:50 +00:00
Remi NGUYEN VAN
ca1820bf2f Add NetworkStack networking deps to SystemApi
Test: atest FrameworksNetTests
Bug: 112869080
Change-Id: Id59dc06fb85e4ac88098f56b621ec880610759ce
2019-01-25 09:05:58 +09:00
Dan Albert
fe1cdd047f resolve merge conflicts of fb54fde402 to master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7256999a13b713607cfb4c844bf1bc7b37b827a7
2019-01-24 14:46:02 -08:00
Dan Albert
9f73671651 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00