Commit Graph

862 Commits

Author SHA1 Message Date
junyulai
1fb0c95661 [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
Varun Anand
262381fcdc Merge "Add an API that allows VPNs to declare themselves as metered." am: 35200a3b8a am: d4bdf28a26
am: ef0938774d

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037
2019-01-30 20:11:09 -08:00
Varun Anand
35200a3b8a Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Varun Anand
83759ee94b 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
768ea1206d 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
f71c4dfb77 Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c am: 19542eea9e
am: b7829c8fec

Change-Id: I2059d9cfa3015388301a74828255354b6dc23c23
2019-01-29 21:42:29 -08:00
Remi NGUYEN VAN
6e82be4e4a 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
0d31afb2a0 Merge "Whitelist packages from VPN lockdown." am: 76e3e0052c am: f6c5ef95d1
am: e4dab6797f

Change-Id: Ice1f8f27da3d0092af58c8e93969575ba9f8f925
2019-01-28 22:13:24 -08:00
Pavel Grafov
76e3e0052c Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
8f8deae60f Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
b19997dbe9 Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 06:57:25 +00:00
Remi NGUYEN VAN
98d9df7a9b 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
e167e117c1 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
8bd18cff9a 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
1e67080e20 Merge "Add NetworkStack networking deps to SystemApi" 2019-01-28 02:58:01 +00:00
Pavel Grafov
3aeb3f3455 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
Remi NGUYEN VAN
b432c2c45c Add NetworkStack networking deps to SystemApi
Test: atest FrameworksNetTests
Bug: 112869080
Change-Id: Id59dc06fb85e4ac88098f56b621ec880610759ce
2019-01-25 09:05:58 +09:00
Dan Albert
dfaba10dba resolve merge conflicts of 511c26364f 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
7e81ae73b4 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00
Dan Albert
45f1a24661 Revert "Whitelist packages from VPN lockdown."
This reverts commit f1a610a1c2.

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

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
Treehugger Robot
b11e29d4b3 Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Pavel Grafov
bec7854508 Merge "Whitelist packages from VPN lockdown." 2019-01-24 17:34:55 +00:00
Pavel Grafov
f1a610a1c2 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
Pavel Grafov
affdbb9b26 Merge "Whitelist packages from VPN lockdown." 2019-01-24 16:15:08 +00:00
Irina Dumitrescu
de132bb6d6 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
TreeHugger Robot
f2cef662ec Merge "Add API for proxy configuration over VPN." 2019-01-24 15:09:18 +00:00
Irina Dumitrescu
8767f41688 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
2019-01-24 12:54:19 +00:00
Lucas Lin
b723dfe0de Merge "Popup a notification after logging in the captive portal network" am: 01eeab4954 am: 37f5d453ee
am: 3037c709a7

Change-Id: I62b9ef24f3a7f9fe75450a05d19dffda3b84d4b5
2019-01-24 03:56:21 -08:00
Pavel Grafov
58e8be00ee Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
2019-01-24 11:34:17 +00:00
Lucas Lin
01eeab4954 Merge "Popup a notification after logging in the captive portal network" 2019-01-24 11:06:12 +00:00
lucaslin
b1e8e385dd 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
Junyu Lai
d412f97c5d Merge changes from topic "ka05" am: 455df13823 am: 81a501ea8d
am: 3f899a7fdb

Change-Id: Ie56c431a6d934c752d1de30fc4bf98a7e557e5b2
2019-01-23 22:24:41 -08:00
junyulai
d05a192fbe [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
Lorenzo Colitti
4fd5a42479 Merge "Stop depending on the ConnectivityService default request." am: bb5952107d am: 0b27bd5aeb
am: dd1c03b05c

Change-Id: Ia3730d55442da165b779242a35c7c66bd0d9b8fe
2019-01-23 08:36:21 -08:00
junyulai
4c95b08a23 [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
bb5952107d Merge "Stop depending on the ConnectivityService default request." 2019-01-23 12:29:40 +00:00
Lorenzo Colitti
0d1aaee1dd 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
ee2429335b Merge changes If71fadd2,I42047185 am: 2b428221cb am: 3b0efeaf61
am: db127de672

Change-Id: Ia91e6eac1b53fabb018fb4e1f689bb986e895ca4
2019-01-22 15:29:37 -08:00
Chalard Jean
2b428221cb 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
1ad4ef9385 Merge "Add API for VPN apps to query always-on and lockdown." am: 5e135e2bdc am: d332a50c1f
am: 8bfc3feb3f

Change-Id: Ied8e5a01cdf76d8da02d2dc292943e6a559cc84e
2019-01-22 07:19:18 -08:00
Pavel Grafov
5e135e2bdc Merge "Add API for VPN apps to query always-on and lockdown." 2019-01-22 14:43:06 +00:00
Chalard Jean
7f8be9f6ca [MS09] Implement isSameNetwork.
Test: Old tests pass, new tests pass too.
Bug: 113554482

Change-Id: I420471853f3fab7725cba7ae500cebdce1912e43
2019-01-22 19:10:48 +09:00
Remi NGUYEN VAN
d943a3ad36 Merge "Add NetworkStack metrics to system API" am: bda2c4fe17 am: 65599b3ca1
am: 330a49d63c

Change-Id: I848ac4c2bb8d35a2f756f97e57f9a61698c00f57
2019-01-22 00:28:03 -08:00
Remi NGUYEN VAN
bda2c4fe17 Merge "Add NetworkStack metrics to system API" 2019-01-22 07:48:39 +00:00
Lorenzo Colitti
9484decee4 Merge "Properly expect all callbacks in testStackedLinkProperties." am: 98dda351ac am: 2244ef14a8
am: 63b0c7c37f

Change-Id: I615f412f7696752d867337ab5cbabe24daea2ed3
2019-01-21 23:00:00 -08:00
Lorenzo Colitti
4433025623 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
2019-01-22 10:53:00 +09:00
Remi NGUYEN VAN
c8bf99d5d9 Add NetworkStack metrics to system API
Test: atest FrameworksNetTests NetworkStackTests
Bug: 112869080
Change-Id: Ie52c55f248c173e2a5ee603ecd004fbac9004ac1
2019-01-21 23:24:41 +00:00
Chalard Jean
999ca436ed Merge changes I2ddfef0c,I49bee0c9 am: 1feafc2e2a am: ae62bfc346
am: 16e7e25468

Change-Id: I369bf5d92a3f70e789043d33bcbc85099aebbb69
2019-01-21 11:28:55 -08:00
Pavel Grafov
e87b7ceaa6 Add API for VPN apps to query always-on and lockdown.
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Bug: 72628179
Change-Id: I73cb0888f7049b12ab0cdfa62678c3846e074d3b
2019-01-21 13:48:45 +00:00
Chalard Jean
b8997229ad [MS08] Read back attributes and blobs.
Test: New tests in IpMemoryStore
Bug: 113554482

Change-Id: I2ddfef0c2ed37459c038f75d1dfc92fdefbf58f5
2019-01-21 15:21:09 +09:00