Commit Graph

5612 Commits

Author SHA1 Message Date
Paul Hu
6bc7032b85 Merge "Add DnsResolverServiceManager" 2020-12-29 02:14:59 +00:00
Remi NGUYEN VAN
a9b2fddb51 Merge "Register ethernet listeners on specific Executors" 2020-12-28 07:12:45 +00:00
Chiachang Wang
dcb4051101 Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged" 2020-12-28 01:05:28 +00:00
Serik Beketayev
4abaecefc2 [Mainline] Migrate ProxyInfo
Bug: 173455434
Test: atest FrameworksNetTests
Change-Id: I924aed710b62a0c91b888a9e04ac2c90cdfd88d0
2020-12-23 22:15:51 -08:00
Aaron Huang
120dfbbec5 Have NetworkPolicyManagerService create MultipathPolicyTracker
To make connectivity service mainline, this patch makes
MultipathPolicyTracker as a submodule of NetworkPolicyManagerService
to remove the dependencies of ConnectivityService.

Bug: 175015282
Test: FrameworksNetTests
Change-Id: I82a7c62069ffd0683deb2f5ce2f99de120a2a16f
2020-12-23 23:17:15 +08:00
Chiachang Wang
4dd4e08c4e [IT4.2] Update argument type of interfaceClassDataActivityChanged
The argument type of interfaceClassDataActivityChanged takes a
string for the network type. It requires both the receivers and
NMS to do type transformation. The transformation is a redundant
work. Update it to take integer directly and rename to
understandable naming.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ibe9fa7a1b71af2dab916b5d615742e77e4174c39
2020-12-23 17:34:08 +08:00
Chiachang Wang
baef452e38 Merge "[IT04] Add uid as parameter of interfaceClassDataActivityChanged" 2020-12-23 05:20:33 +00:00
Remi NGUYEN VAN
3ed4fd3a89 Merge "Split NetworkUtils and NetworkUtilsInternal" 2020-12-23 01:19:27 +00:00
paulhu
b6fcddfd5d Add DnsResolverServiceManager
Add DnsResolverServiceManager to obtain android.net.IDnsResolver
IBinder for incoming connectivity service mainline.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ibd7a678ceaaa550ff3d8eff1d0c4d3a5073b5527
2020-12-22 21:31:39 +08:00
Benedict Wong
ba3f1179a8 Merge "Add additional javadoc for VcnManager" 2020-12-22 08:11:02 +00:00
Chiachang Wang
9c133bc4e9 [IT04] Add uid as parameter of interfaceClassDataActivityChanged
Add uid into interfaceClassDataActivityChanged in
INetworkManagementEventObserver. This helps the listeners to use
BaseNetworkObserver to listen for target evnets instead of using
whole INetdUnsolicitedEventListener with no-op in other event
that listeners do not care about.

Bug: 170598012
Test: m ; atest FrameworksNetTests
Change-Id: I2a42a522c2ff9b1e0be88261a8574bb7f5292fa6
2020-12-22 08:39:22 +08:00
Benedict Wong
c0e2e1c9bd Merge changes Ifabf5e2b,I2e632532
* changes:
  Add persistence for VcnConfig objects by Subscription Group
  Implement basic VcnConfig and VcnGatewayConnectionConfig
2020-12-21 07:10:36 +00:00
Chalard Jean
eeb7c450aa Merge "Move module utils to the module package." 2020-12-21 05:35:09 +00:00
Chiachang Wang
6703edcfed [IT03] Add replacement methods for network activity
Reference for NMS in ConnectivityManager should be removed for
incoming CS mainline. The API for listening network activity
should not go into NMS. As an alternative, the registry requests
should be sent to CS and handled by CS. Add necessary alternative
in IConnectivityManger first. The detail implementation will be
added in the follow up commits.

Bug: 170598012
Test: m
Change-Id: If4d24b937feb88a61f22073af2f671cf20298364
2020-12-21 03:48:54 +00:00
Benedict Wong
7fb0db69b4 Add additional javadoc for VcnManager
This change adds additional detail for the VCN, describing feature set,
use cases and fail-safe modes.

Bug: 163431877
Test: Compiles, Boots (Comment-only change)
Change-Id: I1f82267c20dbbf5875ae27117debdb58f7b96e57
2020-12-18 09:08:54 +00:00
Benedict Wong
ab1b484ac7 Add persistence for VcnConfig objects by Subscription Group
This commit adds the ability for the VcnManagementService to track/store
VCN profiles by subscription groups, and saving/loading to/from disk.

Bug: 163611304
Test: New tests added, passing
Change-Id: Ifabf5e2be090d529cd29e2c68d55ece4858b2aad
2020-12-17 17:17:13 -08:00
Benedict Wong
264973663c Implement basic VcnConfig and VcnGatewayConnectionConfig
This change adds some of the basic fields in VcnConfig and
VcnGatewayConnectionConfig, plus adds a persistability layer to ensure
all VcnConfig(s) are disk-stable.

Bug: 163602123
Bug: 163594033
Test: New tests added, passing
Change-Id: I2e632532809e7768b284be376f2b0a77f634fef5
2020-12-16 17:51:58 -08:00
Chalard Jean
95b575f468 Move module utils to the module package.
Test: FrameworksWifiTest FrameworksNetTest
Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25
Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
2020-12-16 11:44:22 +09:00
Sarah Chin
7f21ec08f7 Move phone ID to extra for action provision
Previously, the phone ID was appended to the broadcast in DCT and sent
to ConnectivityManager. Instead of sending both as an action, send the
phone ID as an extra instead to make the action a protected broadcast.

Test: manually verify a SecurityException when action provision is sent
Test: atest DcTrackerTest
Bug: 172459128
Change-Id: Ic4129def86949d7191d15056852718dadbd72fba
Merged-In: Ic4129def86949d7191d15056852718dadbd72fba
2020-12-15 10:55:22 -08:00
Remi NGUYEN VAN
eada640d5d Merge changes from topic "tcp_keepalive_fix"
* changes:
  Use API TcpKeepalivePacketData in ClientModeImpl
  Add TcpKeepalivePacketData to SystemApi
2020-12-15 09:02:55 +00:00
Remi NGUYEN VAN
32a5b51fe2 Register ethernet listeners on specific Executors
Have users of EthernetManager#addListener specify an Executor instead of
running callbacks on ConnectivityThread.
For existing clients, run callbacks on the common BackgroundThread.

This change in behavior is fine because addListener is not an API, the
threading model in Q was to run callbacks on the looper of the thread
that first created EthernetManager (so there is already no guarantee on
which thread is used), and the only users are in Settings.

ConnectivityThread is moving to a connectivity-specific JAR, so it
should not be used by external classes.

Bug: 174436414
Test: Ethernet client / tethering working
      atest TetheringIntegrationTests
Change-Id: Ic9a959f89915329f79eeeaa0a210ad50811d1291
2020-12-15 17:57:32 +09:00
Chiachang Wang
9924f6ac8f Merge "Remove hidden deprecated getActiveNetworkQuotaInfo" 2020-12-15 07:02:54 +00:00
Chiachang Wang
8fd2f6d2aa Remove hidden deprecated getActiveNetworkQuotaInfo
getActiveNetworkQuotaInfo has never been in API surface since it
was introduced. It became essentially functionless since android O,
so there should be no usage dependency upon the hidden method,
In order to support ConnectivityService mainline, remove the
useless function to prevent necessary dependency.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: Ia685b3260256d465ef614b2f577d13344074c787
2020-12-15 06:45:50 +00:00
Remi NGUYEN VAN
103ec4aa8d Add TcpKeepalivePacketData to SystemApi
This is consistent with NattKeepalivePacketData, which is also a
subclass of KeepalivePacketData.

TcpKeepalivePacketData is already used by the wifi module, but
statically linked.

Bug: 172789687
Test: m
Change-Id: I6aee1ae205987521bea4a3838bbece279ffa0e37
2020-12-14 18:43:44 +09:00
Paul Hu
f24f42ad0f Merge "Expose TcpRepairWindow as module-lib API" 2020-12-11 05:37:10 +00:00
Chalard Jean
362fc1ca1f Merge changes from topic "remove_legacy_NA"
* changes:
  Remove support for legacy network agents
  Remove deprecated constructors for NetworkAgent
  Migrate NetworkAgentWrapper to the new NA API
  Cleanup TestNetworkService
2020-12-11 02:32:57 +00:00
Jeff Sharkey
c9dc68f063 Merge "Update OWNERS info for NetworkPolicy related files." 2020-12-10 14:33:07 +00:00
Sudheer Shanka
7012c9e873 Update OWNERS info for NetworkPolicy related files.
Test: n/a
Change-Id: I8abcde37bd76bc1078119ca10232a46130668306
2020-12-10 08:19:35 +00:00
Lorenzo Colitti
435d580374 Merge changes I6eb6d92b,I638e29fd,I2348b7a3
* changes:
  Add a convenience method to update a network's capabilities.
  Disallow NetworkAgents from changing the owner UID.
  Observe mOwnerUID in NetworkCapabilities#equals.
2020-12-10 08:11:52 +00:00
Lorenzo Colitti
039ed698f1 Observe mOwnerUID in NetworkCapabilities#equals.
Currently, NetworkCapabilities's equals and hashCode methods
ignore mOwnerUID. This is confusing because it is inconsistent
with pretty much every other member of this class.

Bug: 175188445
Test: atest CtsNetTestCases:NetworkAgentTest \
            CtsNetTestCases:Ikev2VpnTest \
	    CtsNetTestCases:VpnServiceTest HostsideVpnTests \
	    CtsNetTestCases:android.net.cts.ConnectivityDiagnosticsManagerTest \
	    ConnectivityServiceTest com.android.server.connectivity.VpnTest
Change-Id: I2348b7a35f32a931687f2d3c2fa57620a12fe06f
2020-12-09 19:33:32 +09:00
paulhu
81bbd3c1db Expose TcpRepairWindow as module-lib API
Connectivity service is going to become a mainline module which
will not be able to access hidden APIs. TcpKeepaliveController
is a part of CS mainline module, it uses TcpRepairWindow to
store tcp repair window info. Thus, expose TcpRepairWindow as
module-lib API to support the usage.

Bug: 172183305
Test: atest FrameworksNetTests
Change-Id: I1b6f5ae698f4b6e030a0f776aeafc774fa9f1437
2020-12-09 08:25:13 +00:00
Chalard Jean
b27cdc85e3 Remove support for legacy network agents
Test: FrameworksNetTests NetworkStackTests
Bug: 167544279
Change-Id: Ia950e16d991cd08d4b609d71aad61a4a4f7fda39
2020-12-08 19:43:11 +09:00
Chalard Jean
4290037d5e Remove deprecated constructors for NetworkAgent
Finally.

Now that mLegacy is always false, removing the support
for legacy agents, a follow-up change will remove
the member and all the associated code.

Test: FrameworksNetTests NetworkStackTests
Bug: 167544279
Change-Id: I6e2c27facdd3ecc232a0aa32bf57c33cb06f118e
2020-12-08 19:43:11 +09:00
Remi NGUYEN VAN
684a7409e6 Split NetworkUtils and NetworkUtilsInternal
NetworkUtils is planned to move to a dedicated JAR for connectivity
classes, while NetworkUtilsInternal would stay in the
frameworks-minus-apex JAR, in the com.android.internal.net package.

Bug: 171540887
Test: m, boots, wifi working
      atest FrameworksNetTests
Change-Id: I3d38d72ad23a4bf84af823c7baeb6fed25c0665f
2020-12-07 19:41:49 +09:00
Serik Beketayev
9817226d99 [Mainline Migration] Migrate NetworkUtils
Migrating makeStrings(), numericToInetAddress() APIs

Bug: 173089079
Test: atest FrameworksNetTests
Change-Id: Ie914fd41bc3ce16d07f5d2768b89ce805b9245a9
2020-12-06 22:33:04 -08:00
Treehugger Robot
c20770fee5 Merge "Remove NATT keepalive from IpSecTransform" 2020-12-04 02:07:56 +00:00
Remi NGUYEN VAN
75304108e7 Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" 2020-12-04 02:05:01 +00:00
Remi NGUYEN VAN
1ded24221e Merge "Set NetworkIdentity subscriberId on all networks" 2020-12-04 02:03:29 +00:00
Patrick Rohr
176ba02184 Merge changes from topic "restricted-networking-mode"
* changes:
  Add Restricted Mode Firewall Chain
  Clean Up NetworkManagementService Tests
2020-12-03 10:50:25 +00:00
Remi NGUYEN VAN
179419f810 Merge "Remove hidden API usage in metrics toString" 2020-12-03 03:21:42 +00:00
Remi NGUYEN VAN
692a8748a5 Merge "Do not query CS in NetworkProvider constructor" 2020-12-03 01:48:01 +00:00
Remi NGUYEN VAN
e8f300c360 Merge "Remove CaptivePortal deps on @hide MetricEvents" 2020-12-02 11:12:56 +00:00
Remi NGUYEN VAN
71cd774f68 Merge "Add ConnectivityManager.TYPE_PROXY to SystemApi" 2020-12-02 09:23:27 +00:00
Remi NGUYEN VAN
79664cbf54 Set NetworkIdentity subscriberId on all networks
Instead of setting NetworkIdentity.subscriberId only on telephony
networks, set it when provided on any network. At the moment only
telephony is expected to have a subscriberId in its NetworkState anyway,
and while there are plans for other network agents (wifi) to have a
subscriberId, it should also be set in that case.

This allows NetworkIdentity to stop depending on hidden network type
APIs to determine if the network is mobile.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I4f09987f8737d1801342eb5d6d7c2b9968b466b0
2020-12-02 18:11:16 +09:00
Remi NGUYEN VAN
c755617364 Remove hidden API usage in metrics toString
Remove usage of hidden NetworkType, transport APIs in toString()
implementations of metrics and data usage classes.

The toString implementations can log the transports or network type as
hex or raw indices. While slightly less readable, the metrics classes
and network type APIs are deprecated.

Bug: 174436414
Test: m
Change-Id: I79239a540b66dadd3bbe0a997960530878331358
2020-12-02 18:10:59 +09:00
Remi NGUYEN VAN
1b06ca6e89 Remove CaptivePortal deps on @hide MetricEvents
The legacy metrics are deprecated, and CaptivePortal is planned to move
to a connectivity-specific jar which cannot reference MetricsEvents.

Bug: 171540887
Test: m
Change-Id: I409375de3844a7fedef707cf9e19a106d82a8e3a
2020-12-02 13:17:09 +09:00
Patrick Rohr
9aabc50ec9 Add Restricted Mode Firewall Chain
Adding new allowlist firewall chain to support restricted networking
mode. See go/restricted-networking-mode.

Bug: b/157505406
Bug: b/170323408
Test: atest NetworkManagementServiceTest
Change-Id: I8e39b3d7b129ad74224d0c1311135b7b48f6514f
2020-11-30 18:36:02 +01:00
Remi NGUYEN VAN
7f159cf640 Add ConnectivityManager.TYPE_PROXY to SystemApi
This follows other TYPE_* constants like TYPE_WIFI_P2P that are
@SystemApi or public.
TYPE_PROXY has a use-case for the system to set network policies based
on proxy network templates. Although network types are deprecated, that
use-case needs to be supported and significant amounts of network
management would need to be rewritten to stop using network types.

The constant needs to be API as ConnectivityManager is planned to move
out of framework.jar, so only its formal API will be available to the
system server.

Bug: 174436414
Test: m
Change-Id: I266ed6bc59f5eb72302afe14472c93933733c8f8
2020-11-30 19:23:45 +09:00
Remi NGUYEN VAN
8fe718ee81 Remove NATT keepalive from IpSecTransform
The code is unused, and based on ConnectivityManager#startNattKeepalive,
which is deprecated.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I08c6c1baec668a304d971bb6f2328891a5611e6a
2020-11-30 17:24:10 +09:00
Remi NGUYEN VAN
caeabd308e Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn
Instead of sharing the constant from LinkProperties, use the already
defined constant in the NetworkConstants class.

This allows Ikev2VpnProfile to allow depending on non-public
LinkProperties APIs, as LinkProperties is planned to move to
framework-connectivity.

Bug: 174436414
Test: m
Change-Id: I594bb7e81bc7681799c16eff621a5ffd1b29624c
2020-11-30 17:18:51 +09:00