Commit Graph

770 Commits

Author SHA1 Message Date
Etan Cohen
2efc554d92 [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
Remi NGUYEN VAN
2c47aed7dc Merge "Remove hard-coded NetworkStack package name" am: 20bda51d6c am: dba80faaf0
am: ff38ce4336

Change-Id: Ic93c22e03a4ead4ec37b955993a32c8ce284e0a6
2019-02-11 20:44:47 -08:00
Remi NGUYEN VAN
8b3999ca8b 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
80471e1fb5 Merge "[KA03.5] Add stable AIDL parcelable for TcpKeepalivePacketData" am: cbd07b88ab am: f5805a6b5c
am: e8bba9c7d1

Change-Id: I700550160c795becb4c3e37a88328488846d272f
2019-02-06 01:47:49 -08:00
Chalard Jean
a707d25603 Merge "[KA03] Support tcp keepalive offload" am: 5f8ddc2eb1 am: 0bebdf2e1e
am: 020998a27b

Change-Id: I55d7b285a75946713986163fbaa166d4b02513d4
2019-02-05 22:41:37 -08:00
junyulai
8c1586e956 [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
46f41d4b16 [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
21c06d06ce [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
junyulai
3a5caf833b [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
5df275d272 Merge "Add an API that allows VPNs to declare themselves as metered." am: fcfc88d14e am: 84bec449a3
am: f6a2a46752

Change-Id: I74c6eceaa7444d0cc79fac3b94151a1bdeb63037
2019-01-30 20:11:09 -08:00
Varun Anand
fcfc88d14e Merge "Add an API that allows VPNs to declare themselves as metered." 2019-01-31 02:43:25 +00:00
Varun Anand
5ccd6bd9e4 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
7265562175 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
7a45071808 Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c am: 0adf9260fc
am: 6d834433ac

Change-Id: I2059d9cfa3015388301a74828255354b6dc23c23
2019-01-29 21:42:29 -08:00
Remi NGUYEN VAN
9e7e213995 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
45e14f9576 Merge "Whitelist packages from VPN lockdown." am: 2c13733fac am: 4513467368
am: a9c8b8a489

Change-Id: Ice1f8f27da3d0092af58c8e93969575ba9f8f925
2019-01-28 22:13:24 -08:00
Pavel Grafov
2c13733fac Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
1ee45c9bfb Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
fd36bc7e74 Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 06:57:25 +00:00
Remi NGUYEN VAN
4427014710 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
926e230392 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
d57b49cb4b 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
29d41a316d Merge "Add NetworkStack networking deps to SystemApi" 2019-01-28 02:58:01 +00:00
Pavel Grafov
4753f40339 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
ae98229898 Add NetworkStack networking deps to SystemApi
Test: atest FrameworksNetTests
Bug: 112869080
Change-Id: Id59dc06fb85e4ac88098f56b621ec880610759ce
2019-01-25 09:05:58 +09:00
Dan Albert
61bb568007 resolve merge conflicts of d7f2320945 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
0246fc7f38 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00
Dan Albert
bc9dd2b1aa Revert "Whitelist packages from VPN lockdown."
This reverts commit b66ec9bbf7.

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

Change-Id: Iaf5c8aa4a8720eb2852da8cd91c81a77ccb92b68
2019-01-24 21:05:39 +00:00
Treehugger Robot
a72ef3ff55 Merge "Add API for proxy configuration over VPN." 2019-01-24 17:52:22 +00:00
Pavel Grafov
5bc0c4f1ca Merge "Whitelist packages from VPN lockdown." 2019-01-24 17:34:55 +00:00
Pavel Grafov
b66ec9bbf7 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
a7789bb2f0 Merge "Whitelist packages from VPN lockdown." 2019-01-24 16:15:08 +00:00
Irina Dumitrescu
0eafa0b5c8 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
4601fb3171 Merge "Add API for proxy configuration over VPN." 2019-01-24 15:09:18 +00:00
Irina Dumitrescu
3a83884883 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
9109b27996 Merge "Popup a notification after logging in the captive portal network" am: 08bf40cfd1 am: 0c3a341e99
am: d2b0ad1fb5

Change-Id: I62b9ef24f3a7f9fe75450a05d19dffda3b84d4b5
2019-01-24 03:56:21 -08:00
Pavel Grafov
a2f5288aed 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
08bf40cfd1 Merge "Popup a notification after logging in the captive portal network" 2019-01-24 11:06:12 +00:00
lucaslin
1ac7239053 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
56277ab83f Merge changes from topic "ka05" am: 908eb08326 am: 9a4614f4b0
am: ee5162e5b5

Change-Id: Ie56c431a6d934c752d1de30fc4bf98a7e557e5b2
2019-01-23 22:24:41 -08:00
junyulai
48a5938ee8 [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
ce00c34e01 Merge "Stop depending on the ConnectivityService default request." am: af9048348f am: db0eb579ee
am: 237cbb7b83

Change-Id: Ia3730d55442da165b779242a35c7c66bd0d9b8fe
2019-01-23 08:36:21 -08:00
junyulai
a86defca11 [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
af9048348f Merge "Stop depending on the ConnectivityService default request." 2019-01-23 12:29:40 +00:00
Lorenzo Colitti
4d4798edba 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
ad716115c8 Merge changes If71fadd2,I42047185 am: a5ca09f7ce am: 0b8d5e2217
am: 5a79e49e8d

Change-Id: Ia91e6eac1b53fabb018fb4e1f689bb986e895ca4
2019-01-22 15:29:37 -08:00
Chalard Jean
a5ca09f7ce 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
833939a5c9 Merge "Add API for VPN apps to query always-on and lockdown." am: c9ea55c3f7 am: 721dbccad1
am: ec53cd06b0

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

Change-Id: I420471853f3fab7725cba7ae500cebdce1912e43
2019-01-22 19:10:48 +09:00