Commit Graph

43820 Commits

Author SHA1 Message Date
Treehugger Robot
d6751bd159 Merge "Fix tab by replacing it with spaces" 2022-02-11 09:35:32 +00:00
Treehugger Robot
5be94579d4 Merge "Refer to SDK constant defined in DevSdkIgnoreRule" 2022-02-11 09:23:02 +00:00
Chiachang Wang
137bbed860 Refer to SDK constant defined in DevSdkIgnoreRule
Refer to the same constant definition as other tests instead of
hard coding locally, so that it won't be missed as changing to
Build.VERSION_CODES.SC_V2.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I3c17c414d830af03e2719c5dab1a664c55f6df2a
2022-02-11 07:40:58 +00:00
Aaron Huang
b5af0fe5dc Fix tab by replacing it with spaces
Test: no code changes
Change-Id: I3644c4914486189d58c8e59ac62c6856296cce08
2022-02-11 13:52:29 +08:00
Treehugger Robot
9fb978d7d7 Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity" 2022-02-11 02:41:54 +00:00
James Mattis
38872800dd Merge "Add @SupressLint to get around incorrect warning." 2022-02-10 22:26:06 +00:00
Treehugger Robot
0fc2ec6d68 Merge "remove unneeded inclusions of libbpf_android" 2022-02-10 19:50:34 +00:00
Bob Badour
4ef4a444e8 [LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  netd/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ib1377fbb050fe52ee195eec58fea67ef769a487a
2022-02-10 10:57:23 -08:00
Treehugger Robot
baefbc3375 Merge "Move IpSec APIs to Connectivity module" 2022-02-10 11:45:21 +00:00
Robert Horvath
3a33495992 Merge "Add Low Power Standby test to NetworkManagementServiceTest" 2022-02-10 11:17:44 +00:00
Junyu Lai
d54fcc49a7 Merge "Add visibility for core tests" 2022-02-10 09:23:57 +00:00
Lorenzo Colitti
bf9d21a6d2 Merge "Add OWNERS for Nearby code" 2022-02-10 08:16:55 +00:00
Remi NGUYEN VAN
d8965edd3d Add OWNERS for Nearby code
Add owners to Nearby members for the nearby directory and framework-t
API directory.

Test: m
Change-Id: I1095064de389ab5f035d8750c0106195d1c167ac
2022-02-10 15:27:29 +09:00
Aaron Huang
2e778ee46b Move IpSec APIs to Connectivity module
(cherry picked from commit 68ca373929)
Bug: 204153604
Test: TH
Change-Id: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
Merged-In: If4afabdc65ed2ac3e918af1d4a03c4c9173c4a3c
2022-02-10 14:25:04 +08:00
Maciej Żenczykowski
11ab996252 remove unneeded inclusions of libbpf_android
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6aedf507e09effd9076de85a0acc7aaf1b8e4a1e
2022-02-09 22:10:22 -08: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
ec05b337aa Merge "Pass the NetworkAgentConfig to NetworkMonitor." 2022-02-09 16:55:59 +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
Nucca Chen
34e16b9537 Merge "Move Tether4Key and Tether4Value to common libs" 2022-02-09 13:53:41 +00:00
Patrick Rohr
2857ac4dd0 Add bandwidth limiting to CS
Adds ingress rate limiting functionality to ConnectivityService. The tc
rate limit is installed before we tell netd about the interface, and
removed after the network is removed from netd. When the setting
changes, the old rate limit needs to be removed before a new one can be
added (unfortunately, we cannot use NLM_F_REPLACE when configuring the
tc-police filter).

Currently, this functionality is always enabled, but may or may not work
based on kernel support.

Bug: 157552970
Test: atest FrameworksNetTests:ConnectivityServiceTest
Change-Id: I4e64b2c40490f061e42b40a1b1b3a6618c3d1a87
2022-02-09 14:46:26 +01: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
Treehugger Robot
0ad3becd60 Merge changes from topic "split-pre-jarjar"
* changes:
  Enable framework-connectivity-t-pre-jarjar for service-t
  Split out connectivity-t-pre-jarjar and tests
2022-02-09 12:54:46 +00: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
Hungming Chen
887a22cc4a Move Tether4Key and Tether4Value to common libs
EthernetTetheringTest needs to parse BPF map content for IPv4
forwarding rule tests. Move the struct class files to common
libs.

Compare Tether4{Key, Value}.java between frameworks/libs/net/common
and packages/modules/Connectivity/Tethering.
There is only the package name change as expected.

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Key.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Key.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

$ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/Tether4Value.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/Tether4Value.java
17c17
< package com.android.networkstack.tethering;
---
> package com.android.net.module.util.bpf;

Test: atest TetheringCoverageTests

Change-Id: I73c180fa4129aefde1e64ecbafe928f388b061d6
2022-02-09 10:45:37 +00:00
junyulai
91e3dc2fe6 Enable framework-connectivity-t-pre-jarjar for service-t
framework-connectivity-t-pre-jarjar build target is needed
by service-t, thus, enabled this target on sc-mainline-prod
but still keep framework-connectivity-t disabled.

Bug: 204830222
Test: m
Change-Id: I03cbdb57966b746f3c93e989394a4dc999fe863a
2022-02-09 18:29:56 +08:00
Remi NGUYEN VAN
2ba9dbe163 Split out connectivity-t-pre-jarjar and tests
The pre-jarjar variant is necessary so that service-t can depend on
hidden symbols in framework-t that reference (for example as parameter)
classes that are jarjared.
Without this, when depending on framework-connectivity-tiramisu.impl,
service-connectivity-t would see post-jarjar symbols that do not match
the classnames it uses in its code.

Also split FrameworksNetTestsLib so that the same jarjar rules can be
applied between the tests and the module, avoiding different errors
between FrameworksNetTests and ConnectivityCoverageTests.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Bug: 204830222
Test: m
Change-Id: I3d0c081c4a7422e128beee11c0156f01b0377c96
Merged-In: I3d0c081c4a7422e128beee11c0156f01b0377c96
2022-02-09 18:29:30 +08:00
Ken Chen
d04a1ef466 Merge "Change gid of cgroupskb/<ingress|egress>/stats" 2022-02-09 09:41:56 +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
d490072cd6 Pass the NetworkAgentConfig to NetworkMonitor.
When the network is a VPN, NetworkMonitor needs to know whether
the VPN requests validation, and that information is stored in
NetworkAgentConfig. Pass it.

Test: FrameworksNetTests
Change-Id: I3616f0796b69ce054d92213aafdef43ba7041596
2022-02-09 15:19:38 +09: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
Michael Groover
0762151207 Merge "Marking test receiver as exported." 2022-02-09 05:38:41 +00:00
Ken Chen
e541aa40ac Change gid of cgroupskb/<ingress|egress>/stats
Change gid BPF programs from AID_ROOT to AID_SYSTEM because
system_server needs to access them.

Bug: 202086915
Test: test in Ib0e935ee2b714ac61daceba6d13fa7a20f97f68f
Change-Id: I8c0019f141414994aad2986cc5dfdb7dd027a36a
2022-02-09 10:53:50 +08:00
Lorenzo Colitti
c3f9e0e37c Merge "Revert "Revert "Update the UIDs only after the native network is created""" 2022-02-08 23:45:24 +00:00
Lorenzo Colitti
96a3f144a7 Revert "Revert "Update the UIDs only after the native network is created""
This reverts commit 13b96bc651.

Reason for revert:
- The reverted CL fixes a bootloop on Fi devices and must be submitted again for droidfood stability purposes.
- It's not clear whether the revert actually fixes the test that prompted it.

Change-Id: I68200501d1c587d1c6b3ad81053175c74961a440
2022-02-08 16:21:01 +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
Jordan Demeulenaere
4acd66156a Merge "Revert "Update the UIDs only after the native network is created"" 2022-02-08 12:18:28 +00:00
Jordan Demeulenaere
13b96bc651 Revert "Update the UIDs only after the native network is created"
This reverts commit a7d4766d0d.

Reason for revert: DroidMonitor: Potential culprit for Bug 218308105 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ia9953d023c1eb84846834f92d4f38a72fa14bd30
2022-02-08 10:42:11 +00: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
Jacob Hobbie
4c06b3885d Marking test receiver as exported.
In order to follow the new dynamic receiver paradigm introduced in T, receivers will have to be specifically marked as exported or not exported when registering dynamically. Since this is in a test only, and the test says that it needs the broadcast to be in a different process, mark as exported.

Bug: 161145287
Change-Id: I112d56962e3a6c3043240f8dfab058dc5a728ba9
Test: atest HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
2022-02-07 15:40:49 -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
Rambo Wang
e7036bec68 Merge "Reduce the flakiness of carrier privileges check" 2022-02-07 03:47:52 +00:00
Lorenzo Colitti
0db496ef39 Fix libnetworkstats_test.
If libraries are moved from the platform to a module, the test
will fail with:

CANNOT LINK EXECUTABLE "/data/local/tmp/libnetworkstats_test/arm64/libnetworkstats_test": library "libnetworkstats.so" not found: needed by main executable

This may be because it can't find libnetworkstats.so because that
is in platform.

In any case, since this is the test for libnetworkstats,
dynamically linking libnetworkstats is incorrect, because it
means if the same CL modifies both libnetworkstats and its test,
that CL will run the modified test against the unmodified
libnetworkstats.so on the device, when running updating tests
without reflashing the device.

Also remove libutils because it does not seem to be needed.

Test: atest libnetworkstats_test passes with libraries moved
Change-Id: Id49641c0a919129e2c54531c3995ec7421161002
2022-02-07 02:16:34 +00:00