Commit Graph

1890 Commits

Author SHA1 Message Date
Chalard Jean
d6cedf5ed3 Merge "[KA03] Support tcp keepalive offload" am: 5f8ddc2eb1
am: 0b93464e32

Change-Id: I695f8a96348b3033bd20a2a9d42ac9ee2bd485ad
2019-02-05 22:32:01 -08:00
junyulai
80d0356311 [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
e5591ce2fa [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
Chalard Jean
9a003aaebc Merge "[KA02] internal cleanup and refactor for SocketKeepalive" am: 292da961e6
am: 839c99be82

Change-Id: I242fdacdd70729367f60da80a1a27d8f5a08dff6
2019-02-05 10:39:31 -08:00
junyulai
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.

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
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
Remi NGUYEN VAN
1cb688eab8 Merge changes from topic "bindprocess-resolv" am: af8e41c434 am: 4b8dee1177
am: 301ff56903

Change-Id: I3f35e6719db4a1152281d1143e8756e726d51e64
2019-01-31 00:30:06 -08:00
Remi NGUYEN VAN
301ff56903 Merge changes from topic "bindprocess-resolv" am: af8e41c434
am: 4b8dee1177

Change-Id: I80f85170981c2f5b1ef949b5db88baf5fc101cd0
2019-01-31 00:19:37 -08:00
Mark Chien
4ebd3aaf1e Merge "Add get last entitlement value callback API" am: 029be80b79 am: ffe3d99f91
am: 5433fa3269

Change-Id: If67c8d092dd2c40f95cbe423bc694aa349039541
2019-01-30 23:59:01 -08:00
Remi NGUYEN VAN
af8e41c434 Merge changes from topic "bindprocess-resolv"
* changes:
  Allow use of bindProcessToNetwork only to change private DNS bypass.
  Allow bypassing private DNS via bindProcessToNetwork.
2019-01-31 07:52:04 +00:00
Mark Chien
5433fa3269 Merge "Add get last entitlement value callback API" am: 029be80b79
am: ffe3d99f91

Change-Id: I42892bdacaa41f9cea7e653f0bb9b5497192e5f6
2019-01-30 23:49:43 -08:00
Mark Chien
029be80b79 Merge "Add get last entitlement value callback API" 2019-01-31 07:23:31 +00:00
markchien
0f45bb9d3d 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
Lorenzo Colitti
3c766ebc4d Allow use of bindProcessToNetwork only to change private DNS bypass.
Currently it is not possible to change private DNS bypass by
doing:

  setProcessDefaultNetwork(network.getPrivateDnsBypassingCopy());
  setProcessDefaultNetwork(network);

because the code will ignore the change. Fix this by ensuring
that we always call bindProcessToNetwork (which does not have
side effects) and then only performing the expensive operations
(flushing DNS cache, upating socket pools) if the netId changed.

Bug: 112869080
Test: None
Change-Id: I5e8999cb11d8b8c1e9eb583fa8b3932f212accff
2019-01-31 13:08:24 +09:00
Pavel Grafov
97640add4c Merge "Nuke old setAlwaysOnVpnPackageForUser method." am: 35a8f1a38a am: bd757b5a3d
am: 2bdb01f0a0

Change-Id: I0ca587378c1db327c4e73b18ab5c1c2505f05ce0
2019-01-30 14:50:00 -08:00
Remi NGUYEN VAN
9002494f06 Merge "Add SystemApi for captive portal metrics" am: b591097458
am: 3efa288531

Change-Id: I15adc597039539d53e5c08dc5f8cac74bcb0eda2
2019-01-30 14:42:34 -08:00
Pavel Grafov
2bdb01f0a0 Merge "Nuke old setAlwaysOnVpnPackageForUser method." am: 35a8f1a38a
am: bd757b5a3d

Change-Id: I7f0de294357ae6c691d38be52dd278eb37d42116
2019-01-30 14:36:37 -08:00
Remi NGUYEN VAN
b591097458 Merge "Add SystemApi for captive portal metrics" 2019-01-30 22:24:12 +00:00
Pavel Grafov
4ed5cbd750 Nuke old setAlwaysOnVpnPackageForUser method.
All callers have migrated to 4-argument one.

Test: builds
Bug: 77468593
Change-Id: I253515f6b0100b675505646339e5b82d373c9429
2019-01-30 19:56:36 +00:00
Lorenzo Colitti
3a1cb9d615 Allow bypassing private DNS via bindProcessToNetwork.
Currently, bypassing private DNS requires calling the deprecated
setProcessDefaultNetworkForHostResolution. Allow apps to do this
via the non-deprecated binProcessForNetwork as well.

This has fewer backwards compatibility concerns than the
alternative approach of having setProcessDefaultNetwork call
setProcessDefaultNetworkForHostResolution. That approach would
have been problematic, for example, if an app did:

  cm.bindProcessToNetwork(network);
  ...
  cm.bindProcessToNetwork(null);

In this case, it would be difficult to know whether to clear the
resolver mapping as well: what if an app had also called
setProcessDefaultNetworkForHostResolution?

Similarly, it would be difficult to know what to do if an app did:

  cm.setProcessDefaultNetworkForHostResolution(network);
  cm.bindProcessToNetwork(null);

This approach does not have these concerns, and has no effect
on apps that don't call Network.getPrivateDnsBypassingCopy, which
regular apps don't have permission to use. It also provides a
path to deprecate setProcessDefaultNetworkForHostResolution.

Bug: 112869080
Test: atest android.net.cts.ConnectivityManagerTest android.net.cts.MultinetworkApiTest
Change-Id: I4158a37b6ed87a9a9b2677c526dcfee8af48e483
2019-01-31 00:55:47 +09:00
Remi NGUYEN VAN
f2c71e5a8d Merge "Add SystemApi for captive portal metrics" 2019-01-30 15:19:07 +00:00
Remi NGUYEN VAN
fb43a914d3 Add SystemApi for captive portal metrics
The metrics go through NetworkMonitor in the NetworkStack so that they
can be upgraded to new metrics in the future.

Test: flashed, captive portal login works, metrics shown in events log
Bug: 112869080
Merged-In: I4bccfbd87bae5b2d65e45c7a5918aa45ab5d76e8
Change-Id: Ib5e2126788f8d56a00a56d7efcd33c5f9a37a6de
2019-01-30 22:54:27 +09:00
Remi NGUYEN VAN
6bd9193a3d Add SystemApi for captive portal metrics
The metrics go through NetworkMonitor in the NetworkStack so that they
can be upgraded to new metrics in the future.

Test: flashed, captive portal login works, metrics shown in events log
Bug: 112869080
(Cherry-pick of aosp/890004)

Change-Id: I4bccfbd87bae5b2d65e45c7a5918aa45ab5d76e8
2019-01-30 22:01:20 +09: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
b7829c8fec Merge "Remove last NetworkStack usage of hidden APIs" am: 16ec5d038c
am: 19542eea9e

Change-Id: I488fc028b8fd2aa5a09464082c65a4889a8a6b62
2019-01-29 21:27:50 -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
Remi NGUYEN VAN
d67edd1540 Merge "Add NetworkUtils utilities to SystemApi" am: 9cc31061fe am: 5896eb1b1a
am: 03fe002386

Change-Id: Ib755bbfc5bb6bff4ada3995b70dfe8fc2d40b4f9
2019-01-29 03:39:27 -08:00
Remi NGUYEN VAN
03fe002386 Merge "Add NetworkUtils utilities to SystemApi" am: 9cc31061fe
am: 5896eb1b1a

Change-Id: I978bdb626c1f4c8bbe736c8bad1c74fb6a67b4b5
2019-01-29 03:29:01 -08:00
Remi NGUYEN VAN
c7fe99fdbe Add NetworkUtils utilities to SystemApi
attach*Filter and addArpEntry are necessary for the NetworkStack but are
only usable for apps that have system permissions.
Also includes system API for IpPrefix, LinkAddress, LinkProperties,
Network, and static modifier in ApfCapabilities that were missed in
previous CLs.

Test: Builds, flashed, WiFi works
Bug: 112869080
Change-Id: If141ae6a2f9145f5af64ba002ca44938f39b90a9
2019-01-29 17:30:26 +09:00
Remi NGUYEN VAN
bb818c790f Merge "Add SocketUtils for NetworkStack" am: 37053eb78e am: e90dc24b2c
am: d3e5405831

Change-Id: I6d059f9cd1a694659bfd7ac09a32022d29c03f85
2019-01-28 23:47:36 -08:00
Remi NGUYEN VAN
d3e5405831 Merge "Add SocketUtils for NetworkStack" am: 37053eb78e
am: e90dc24b2c

Change-Id: I89fe62b4baf63104359bb6741807bb2f1666cdd9
2019-01-28 22:57:39 -08: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
e4dab6797f Merge "Whitelist packages from VPN lockdown." am: 76e3e0052c
am: f6c5ef95d1

Change-Id: I10094606f74e6cdc5f4b0b6591cf776fd895b1d3
2019-01-28 21:34:03 -08:00
Remi NGUYEN VAN
37053eb78e Merge "Add SocketUtils for NetworkStack" 2019-01-28 23:14:08 +00:00
Pavel Grafov
76e3e0052c Merge "Whitelist packages from VPN lockdown." 2019-01-28 20:15:49 +00:00
Remi NGUYEN VAN
a628730d0a Add SocketUtils for NetworkStack
These utilities can only be used for privileged apps. The underlying
implementation cannot be @SystemApi.

Test: m
Bug: 112869080
Change-Id: Idfa90561102e5b03ab2b79486d3ad46457128bf8
2019-01-28 20:11:27 +09:00
Remi NGUYEN VAN
8d31333b7d Merge "Move NetworkUtils used by NetworkStack" am: 8f8deae60f
am: 249646cc60

Change-Id: I0d6a40c79e92d1de18c41cc50b72fbe33db13bdc
2019-01-28 01:30:17 -08:00
Remi NGUYEN VAN
8f8deae60f Merge "Move NetworkUtils used by NetworkStack" 2019-01-28 09:06:20 +00:00
Remi NGUYEN VAN
d08b6d2105 Merge "Add NetworkStack networking deps to SystemApi" am: 9188b49259
am: 5fb799d7ee

Change-Id: I843cb189750666a2cb70b1960d49dfe797f3cf36
2019-01-28 00:35:46 -08: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
511c26364f Merge "Revert "Whitelist packages from VPN lockdown."" am: 7e81ae73b4
am: 8840cbd3fa

Change-Id: I933a58f97b48f7a2db372cff6fb43318c840c6f8
2019-01-24 13:58:15 -08:00
Dan Albert
7e81ae73b4 Merge "Revert "Whitelist packages from VPN lockdown."" 2019-01-24 21:08:46 +00:00