Commit Graph

810 Commits

Author SHA1 Message Date
James Mattis
38872800dd Merge "Add @SupressLint to get around incorrect warning." 2022-02-10 22:26:06 +00:00
Junyu Lai
d54fcc49a7 Merge "Add visibility for core tests" 2022-02-10 09:23:57 +00:00
Treehugger Robot
a8ae24410d Merge "[MS55.2] Move NetworkStateSnapshot into module folder" 2022-02-10 05:02:45 +00:00
Chiachang Wang
84ad04f768 Merge "Change naming of excludeLocalRoutes" 2022-02-10 00:50:30 +00:00
James Mattis
d8afb66b11 Add @SupressLint to get around incorrect warning.
EthernetNetworkSpecifier is being moved from being @SystemApi to public.
This is causing the linter to incorrectly throw errors when building on
erro prone. Add @SupressLint to the method causing the errors prevents
the incorrect warning from causing build failures.

Tracking bug b/193460475 - TODO to remove once fixed.

cherry pick of http://ag/16822701

Bug: 210485380
Test: build errorprone
Change-Id: Id297e739a2288ccc232c6b989ec7fee41837a910
Merged-In: Id297e739a2288ccc232c6b989ec7fee41837a910
2022-02-09 11:22:11 -08:00
Patrick Rohr
6b5b7b40d8 Merge changes from topic "bandwidth-limiting"
* changes:
  Add bandwidth limiting to CS
  Add setting that controls network rate limit
2022-02-09 18:00:04 +00:00
Jean Chalard
66fbc7df52 Merge "Mark NetworkAgentConfig fit for inclusion in stable AIDL" 2022-02-09 16:55:44 +00:00
Remi NGUYEN VAN
85a4e07826 Add visibility for core tests
Allow core tests to use hidden connectivity APIs. Benchmark tests in
particular cannot be run without these.

Ignore-AOSP-First: Avoiding merge conflicts, cherry-pick will follow
Bug: 197717846
Test: m
  (cherry-picked from ag/16772124)
Change-Id: Ia01f24317d14b063f9a7e24c3ada11b140641c50
Merged-In: Ia01f24317d14b063f9a7e24c3ada11b140641c50
2022-02-09 23:08:37 +08:00
Patrick Rohr
a20843638f Add setting that controls network rate limit
The INGRESS_RATE_LIMIT_BYTES_PER_SECOND setting controls the rate limit
for internet networks. If set to -1, no rate limit applies.  There is
one global rate limit that will be applied to all networks with
NET_CAPABILITY_INTERNET.

Test: atest ConnectivitySettingsManagerTest
Bug: 157552970
Change-Id: Ia82aa867686d484ce46734f76d4a48bf864eff84
2022-02-09 14:46:26 +01:00
Junyu Lai
dc0d521f63 [MS55.2] Move NetworkStateSnapshot into module folder
framework-connectivity need to see the aidl files when
compiling IConnectivityManager.aidl, and it can only
include the files by specifying aidl include_dirs.
Thus, move the file into the module since the one outside
of the module is going to be deleted soon.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: TH
Bug: 197717846
Change-Id: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283
Merged-In: Ide7431d0c98aebd389bee86d13ff44f5ef8b8283
2022-02-09 10:51:37 +00:00
Aaron Huang
e25900bbbf Merge "Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests" 2022-02-09 10:48:45 +00:00
Chiachang Wang
f890874970 Change naming of excludeLocalRoutes
Address API review feedback to change naming of
setExcludedLocalRoutesVpn and getter.

Bug: 217742354
Test: atest FrameworksNetTests
Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0
2022-02-09 15:50:06 +08:00
Chalard Jean
3068ce7378 Mark NetworkAgentConfig fit for inclusion in stable AIDL
Test: m together with its topic
Change-Id: I897a2081fb48a614f28d9ec3965f99cca9f8ec62
2022-02-09 15:19:38 +09:00
Jean Chalard
4b66d4e244 Merge "Add and implement API for VpnManagers to request validation" 2022-02-09 06:03:45 +00:00
Aaron Huang
720ad7c026 Have connectivity targets be visible to Frameworks[Vcn|Ike]Tests
(cherry picked from commit 7174ac3d86)
Bug: 204153604
Ignore-AOSP-First: part of large topic that only builds internally
Test: build, FrameworksVcnTests, FrameworksIkeTests
Change-Id: I40740200fe4a7476a21bb5330429a11c97e38fb8
Merged-In: I40740200fe4a7476a21bb5330429a11c97e38fb8
2022-02-08 14:31:27 +00:00
Chiachang Wang
865511a8c4 Add and implement API for VpnManagers to request validation
This adds a new API that lets VPN apps using VpnManager request
that the platform run its basic validation check on the resulting
network.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I00092eee857d3e33529b19461cfd5dd060a0fe20
2022-02-08 22:47:26 +09:00
Mingguang Xu
446c376434 Merge "Address API review comments for DhcpOption object" 2022-02-08 07:30:45 +00:00
Mingguang Xu
6914a16c95 Address API review comments for DhcpOption object
Add a link to javadoc for the allowed types and use the lint annotation
to suppress compilation errors instead of modifying the baseline file.

Bug: 213240318

Test: atest FrameworksNetTests
Test: atest NetworkStackTests

Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Change-Id: I2a83cc19baa25068326517b30a9afdea19536af9
2022-02-07 19:42:40 -08:00
Etan Cohen
1e86b3af26 Expose public APIs for IP & static IP configuration
Create public API for IP and static IP configuration.

Bug: 209840828
Test: atest android.net.cts.IpConfigurationTest
Test: atest android.net.cts.StaticIpConfigurationTest
Test: atest android.net.dhcp.DhcpResultsParcelableUtilTest
Change-Id: I720f168d1023806970919ca5dd44239a276826b6
2022-02-07 19:57:07 +00:00
Treehugger Robot
1513c9991e Merge "Fix documentation link" 2022-02-04 06:01:13 +00:00
Robert Horvath
d945bf0b4f Add Low Power Standby support to TrafficController
Bug: 190822356
Test: atest TrafficControllerTest
Change-Id: I84a95081ab6e6a86543fe2cddf0efdab16c90d72
2022-02-02 22:54:21 +01:00
Robert Horvath
c22652401d Merge changes from topic "low-power-standby-connectivity"
* changes:
  Define BLOCKED_REASON_LOW_POWER_STANDBY
  Define FIREWALL_CHAIN_LOW_POWER_STANDBY
2022-02-02 11:23:59 +00:00
Chalard Jean
5fd3cfa342 Use packBitList to prevent long-related mistakes
In the following expression
  1L << CONSTANT
it is easy to forget the L, especially where it has
not been necessary historically. This has happened
in capabilities where they exceeded 30, see
aosp/1928394. Use the new packBitList to avoid
repeats of the same mistake.

Test: FrameworksNetTests
Change-Id: Ic6a1aa9254bf9ad222c3e2fe4f52bb89a1f9c4e5
2022-02-02 13:52:26 +09:00
Robert Horvath
2dac94841a Define BLOCKED_REASON_LOW_POWER_STANDBY
Bug: 190822356
Test: atest NetworkPolicyManagerServiceTest
Change-Id: I72c81ba1c3791e40a2d311cc3a06bf3b5d3727d1
2022-02-01 16:04:35 +01:00
Robert Horvath
34cba14425 Define FIREWALL_CHAIN_LOW_POWER_STANDBY
Bug: 190822356
Test: atest NetworkManagementServiceTest
Change-Id: I970eea0e1952f8074cc5c998bbd2ee1ff5a3dc92
2022-02-01 16:04:35 +01:00
Lorenzo Colitti
eb8d8554bb Rename NetworkUsageStatsTest and move to networking CTS tests.
NetworkUsageStatsTest is the CTS test for the NetworkStatsManager
public APIs. Rename it to NetworkStatsManagerTest, since that is
a better name for it.

Also move it to the networking CTS tests, where it will run on
presubmit on every supported Android version (S, T), and can
access hidden networking APIs. This is important because
NetworkStatsManager is being mainlined in T.

Bug: 204830222
Test: atest CtsNetTestCases:NetworkStatsManagerTest
Change-Id: Ie0fd267aa8bf94594fcc939a8493bef8ab14d3fe
2022-02-01 11:24:39 +00:00
Remi NGUYEN VAN
6a20eeda42 Reorganize connectivity framework dependencies
Allow framework-connectivity to depend on framework-connectivity-t
stubs, and framework-connectivity-t to depend on prebuilt (to avoid
circular dependencies) framework-connectivity stubs to compile its own
stubs, and framework-connectivity.impl to compile its implementation.

Also reorganize jarjar rules so that service and framework jar can use
static libraries in framework-connectivity without packaging their own,
reducing duplicate code.

Bug: 204830222
Test: m
Change-Id: I75c34986e7c479de23cdb2e9b360fa1fede018c9
2022-02-01 13:33:48 +09:00
Chalard Jean
41a602d2b8 Expose access UIDs.
CTS already have basic tests for this since they run the common tests,
which were using these hidden methods already.

Test: CtsNetTestCases
Change-Id: Id5e5b911f5c63bdd3b05e5ac1d3dd89c1c525ab7
2022-01-31 17:04:58 +09:00
Chalard Jean
e6c9527554 Send access UIDs to netd
Test: FrameworkNetTests CtsNetTestCases
Change-Id: I8301abaddf5850071fa23d41e8e736ab7071e299
2022-01-31 17:04:58 +09:00
Chalard Jean
9a30acf744 Add accessUids to NetworkCapabilities.
For now, all entry points reject this. Followup changes
will allow the supported use cases.

Test: new unit tests and CTS for this in this patch
Change-Id: I7262811a2e46336d3bb63c80886fc0578a36da94
2022-01-31 17:04:58 +09:00
Tyler Wear
723882126a Process DSCP QoS events for policies
New events to handle adding and removing of DSCP QoS policies.
Async indication sends status back to client if the policy
has been added, failed, or if the policy limit has been
reached.

Bug: 202871011
Change-Id: I7988d22ae625ad0dd415927d2943de4a749e6fb8
2022-01-27 10:19:27 +00:00
Chiachang Wang
e84d7d90d3 Expose local route exclusion API in NetworkAgentConfig
Bug: 184750836
Test: make update-api
Test: atest FrameworksNetTests
Change-Id: I70470ab3a945570a23607e39d18f9825d9e1d7aa
CTS-Coverage-Bug: 184750836
2022-01-27 09:53:33 +00:00
Sooraj Sasindran
7e9b25e7f9 Add getEnterpriseId api to network request
Bug: 194332512
CTS-Coverage-Bug: 216481336
Test: build
Change-Id: I1446f8eecf43f7c6d243dc82af08d04957dd60e3
2022-01-26 17:26:50 +00:00
Sooraj Sasindran
f8eb713874 Add low latency and high bandwidth network capabilities
Bug: 194332512
Test: build
Change-Id: I415ca1ba90ea54c4106f806fe855bcb84d3e38ba
2022-01-25 09:35:30 -08:00
Sooraj Sasindran
f4a58dcd45 Add support for Multiple enterprise slice
Bug: 194332512
Test: unit test
CTS-Coverage-Bug: 211133973
Change-Id: Ie8be08a7cfa9155168d1da146d02fd1643248bdc
2022-01-22 14:39:40 -08:00
Sooraj Sasindran
499117f279 Ability to specify which all applications fall under enterprise slice.
Bug: 194332512
Test: unit test
Change-Id: I94549a41aaa717add22b0a3e5035beacf6f1b8f2
2022-01-21 01:05:12 -08:00
Mark Chien
0730625a31 Merge "Fix some typos in comments" 2022-01-20 10:17:27 +00:00
Paul Hu
a77cad355b Merge "Build framework-connectivity-tiramisu library" 2022-01-20 03:02:56 +00:00
Kweku Adams
af5b1c0cf2 Fix documentation link
Change-Id: I4b5e77a9007629914af37d7ec85ecdba4f922b87
2022-01-14 17:49:33 +00:00
markchien
68cfadc523 Fix some typos in comments
This is CL just fix comments without changing behavior.

Bug: 209935649
Test: m
Change-Id: Iac40477bd2a3c48ba2a3f75a9cdf1174bcc89c3c
2022-01-14 13:47:13 +08:00
Mark Chien
21f0d58294 Merge "Add swapActiveStatsMap API for NetworkStatsFactory" 2022-01-14 05:35:25 +00:00
Mark Chien
094de6b7c4 Merge "Add replaceFirewallChain API" 2022-01-14 05:33:58 +00:00
Mark Chien
9bba8e8c78 Merge "Add setFirewallChainEnabled API" 2022-01-14 05:33:38 +00:00
Mark Chien
c65ecacd6f Merge "Add updateFirewallRule API" 2022-01-14 05:33:22 +00:00
markchien
9c8061134c Add swapActiveStatsMap API for NetworkStatsFactory
This CL should be reverted before T sdk finalized.
This API is temporary added for the NetworkStatsFactory which is platform
code but will be moved into connectivity (tethering) mainline module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I5894450f3089b2ea105722a18ddf8f1eed1c28a0
2022-01-14 10:23:26 +08:00
markchien
00a0bed534 Add replaceFirewallChain API
To deprecated firewallReplaceUidChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
replaceFirewallChain to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: If7a87548b0a3acda00a1455da4e4ff24a630ddc7
2022-01-14 10:23:21 +08:00
markchien
98a6f95d0f Add setFirewallChainEnabled API
To deprecated firewallEnableChildChain netd binder and move the
functionality to tethering (connectivity) mainline module, expose
setFirewallChainEnabled to support the caller outside the module.
Currently the API are still call to netd. Will replace with the
implementation inside tethering (connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I9b64c9d12260521489a87fbeae5afbee2a8ea8f6
2022-01-14 10:23:15 +08:00
markchien
e1561fa800 Add updateFirewallRule API
To deprecated firewallSetUidRule netd binder and move the functionality to
tethering (connectivity) mainline module, expose updateFirewallRule to
support the caller outside the module. Currently the API are still call
to netd. Will replace with the implementation inside tethering
(connectivity) module.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: I0b53c999e06c2378afec0eb491815ec398c91b0b
2022-01-14 10:19:51 +08:00
Sooraj Sasindran
226131ab48 Merge "Ability for DPM to specify fallback mechanism" 2022-01-13 17:24:07 +00:00
Mark Chien
136f2d2d91 Merge "Add updateMeteredNetwork{Allow, Deny}List APIs" 2022-01-13 08:21:03 +00:00