Commit Graph

918 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
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
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
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
Treehugger Robot
1f9d80f6ee Merge "Fix IPMS tests timeout." 2019-01-25 00:15:50 +00:00
Dan Albert
9f73671651 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00
Dan Albert
ee8e6a0fae Revert "Whitelist packages from VPN lockdown."
This reverts commit bb9cef04c5.

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

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
Treehugger Robot
8b5917965d Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Pavel Grafov
efc773525c Merge "Whitelist packages from VPN lockdown." 2019-01-24 17:34:55 +00:00
Pavel Grafov
bb9cef04c5 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
2019-01-24 16:17:11 +00:00
Irina Dumitrescu
044a436ac9 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
2019-01-24 16:07:20 +00:00
Lucas Lin
6fa3d391b8 Merge "Popup a notification after logging in the captive portal network" 2019-01-24 11:06:12 +00:00
Chalard Jean
f735efc833 Fix IPMS tests timeout.
The tests used to correctly detect failures but would mostly wait
for timeout instead of succeeding immediately. If timeout were to
happen, that would not have been detected.

Test: atest IpMemoryStoreServiceTest
Change-Id: Ic1e7fcac3020739af7dc3e2c294d0838d8ffc711
2019-01-24 19:34:39 +09:00
lucaslin
d2e045e040 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
2019-01-24 15:55:30 +08:00
junyulai
215b877f11 [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
2019-01-24 00:40:25 +08:00
junyulai
48eac1d4c8 [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
2019-01-23 23:17:17 +08:00
Lorenzo Colitti
e62097f71d Merge "Stop depending on the ConnectivityService default request." 2019-01-23 12:29:40 +00:00
Lorenzo Colitti
ed3168e9e3 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
2019-01-23 18:10:06 +09:00
Chalard Jean
8d1a890c5c [MS11] Implement findL2Key
Bug: 113554482
Test: old tests pass, new tests added
Change-Id: I2e93c88c30eae614a6db04abe698e8edf7fa6a43
2019-01-23 16:54:37 +09:00
Chalard Jean
022daeb874 Merge changes If71fadd2,I42047185
* changes:
  [MS10] Address leftover comments on MS03 and MS07
  [MS09] Implement isSameNetwork.
2019-01-22 22:50:21 +00:00
Pavel Grafov
479c0769f1 Merge "Add API for VPN apps to query always-on and lockdown." 2019-01-22 14:43:06 +00:00
Remi NGUYEN VAN
d1b51a3228 Remove InterfaceController dependency on NMS
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ib3773068b087f58f4ac3394291cda132b00b2dcc
2019-01-22 20:25:48 +09:00