Commit graph

111,167 commits

Message SHA1
Add end to end mainline beta test flag in connectivity module
These are dummy no op test flags meant for testing mainline beta
flagging and workflow infras. Will remove them once the test has
completed.

Bug: b/406508072
Test: m and verify in AVD
Flag: EXEMPT build system changes
Change-Id: I3d9326bce2ca0b7b8a61405a88565a1a7674c4db

Dennis Shen   commited 2025-06-11 16:14:34 -07:00
ca4ad86d20
Merge "Move SSLCertificateSocketFactoryTest out of CtsNetTestCases" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-16 04:01:55 -07:00
68d8a44bcf
Merge changes I380d649c,I64734ee7,Ie6f3859e into main
* changes:
  Remove ensureIpServerStartedLegacy.
  Never create IpServers based on interface up for WIFI and WIFI_P2P.
  Rename the methods in the legacy codepath for clarity.

Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-16 02:15:46 -07:00
ceb9f3e819
Merge "Add EthernetPortInfo class" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-05-16 01:39:54 -07:00
59f8d2b8ed
netbpfload.rc: bump to 25q3
(from https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/3560067)

Flag: EXEMPT mainline
Bug: 407617658
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I12007e5113594ad6bba8bcd43bb137471e4698dc

Maciej Żenczykowski   commited 2025-05-16 01:33:52 -07:00
d1c8cc126e
Merge "NetBpfLoad: move .rc docs into .35rc" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-16 01:23:17 -07:00
5ec4c4ae05
Merge "NetBpfLoad: eliminate directory scanning" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-16 00:53:54 -07:00
46a064049c
Remove ensureIpServerStartedLegacy.
Fold the method into its only caller. This is a no-op change.

The only types that could previously make it to this method are
BLUETOOTH pre-T and WIGIG pre-S. Therefore the call to
checkTetherableType is mostly redundant, except for the check
that WIGIG should not be brought up if the device does not
have FEATURE_WIFI. Put that check into the caller as well.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: I380d649c2fd8af8b00a55a5bb7d2254c8b126a34

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
71c1813827
Never create IpServers based on interface up for WIFI and WIFI_P2P.
This is not necessary because creating the IpServer based on
interface events is only necessary for the tether() API, and
field metrics indicate that that API is unused for WIFI and
WIFI_P2P.

Also add comments to clarify when the legacy codepath is taken.

Bug: 408087033
Test: updated unit tests
Flag: EXEMPT refactor
Change-Id: I64734ee710e9782903d4422efb0370d6fec77dd7

Lorenzo Colitti   commited 2025-05-16 15:06:36 +09:00
981a4f35c5
Merge "Add a performance test for filteredClone." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-15 22:42:27 -07:00
c1844e5f8e
Rename the methods in the legacy codepath for clarity.
This is a no-op change.

ensureIpServerStartedForInterface -> ensureIpServerStartedLegacy
ensureIpServerStartedForType -> ensureIpServerStarted

Also pass in the type to ensureIpServerStartedLegacy. There's
no point reading calling ifaceNameToType again, the only thing
this can possibly do is get a new type that disagrees with the
previous one.

Bug: 408087033
Flag: EXEMPT refactor
Test: no-op covered by existing tests
Change-Id: Ie6f3859eab46a085c0d332b5de12473180032102

Lorenzo Colitti   commited 2025-05-16 13:22:06 +09:00
18a0131a4c
Add EthernetPortInfo class
This patch adds EthernetPortInfo class which represents information of
an EthernetPort object.
This class is mainlt used in network callbacks.

Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline

Change-Id: I8ab9fa934a710080163d951bb6619050ca38a2ee

Chuwei He   commited 2025-05-16 13:14:48 +09:00
76330fa8a2
Add a performance test for filteredClone.
atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsTest#testFilteredPerformance -- --auto-collect DEVICE_TRACE

Flag: TEST_ONLY
Change-Id: Id47edc05bb39ce334da819129d4ee13b0796cbb5

Richard Uhler   authored and   Lorenzo Colitti   commited 2025-05-15 21:06:04 -07:00
bcd9653ed3
Merge "Add a test to ensure link-local prefix does not trigger PD" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-15 20:24:41 -07:00
d46183bf8c
Add a test to ensure link-local prefix does not trigger PD
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I77993cf154d4a3351294574735a238bd9db2da71

Patrick Rohr   commited 2025-05-15 18:45:36 -07:00
82d5add0c2
Merge "Backfill new field host_commong_data" into main
Julien Desprez   authored and   Android (Google) Code Review   commited 2025-05-15 10:06:47 -07:00
6c6dfd7be0
Merge "Enable REQUEST_RESTRICTED_WIFI and CARRIER_SERVICE_CHANGED_USE_CALLBACK by default with kill switch" into main
Ying Xu   authored and   Android (Google) Code Review   commited 2025-05-15 09:44:48 -07:00
d49e884b27
NetBpfLoad: move .rc docs into .35rc
The .rc file is just a placeholder, and isn't
truly used, so just move the documentation over
into the apex location which is actually used.

Test: TreeHugger
Flag: EXEMPT comments only
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I505b90f27208ac5b217aca949b8ef044d3a39226

Maciej Żenczykowski   commited 2025-05-15 03:51:57 -07:00
eb0a6a3f25
NetBpfLoad: eliminate directory scanning
The full set of 5 .o's is known at build time, and basically almost
never changes (and indeed is likely to shrink, with clatd.o merged
into offload.o && dscpPolicy.c merged into netd.c).

We might as well just code this knowledge straight into the mainline
loader.

This also allows us to move all the files to an apex subdirectory
that old platform bpfloaders don't even look at, which eliminates
the need for any backward compatibility with them.

Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie3d27178c31a68ed7cf5173b5983ad3009a3cf94

Maciej Żenczykowski   commited 2025-05-15 01:38:16 -07:00
82ce2ca21c
Merge changes I62a9d0a1,Ie50b2f35 into main
* changes:
  Don't ignore exceptions in NsdManagerDownstreamTetheringTest
  Don't warn in tests for deprecation

Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-15 00:05:56 -07:00
43aa539935
Move SSLCertificateSocketFactoryTest out of CtsNetTestCases
Problem:
- SSLCertificateSocketFactory has a bug causing socket leaks in
  certain exception scenarios.
- SSLCertificateSocketFactoryTest triggers this, leading to
  leaked sockets during test runs.
- When run within CtsNetTestCases, the network traffic from these
  leaked sockets interferes with
  TrafficStatsTest#testTrafficStatsForLocalhost, which monitors
  traffic by UID within that same suite.
- This interference causes TrafficStatsTest to be flaky.

Solution:
- Moving SSLCertificateSocketFactoryTest to a different suite
  ensures its leaked socket traffic is no longer associated with
  the same UID context monitored by TrafficStatsTest.
- This isolation prevents the test interference and resolves the
  flakiness.

Flag: TEST_ONLY
Test: atest CtsLibcoreNetTestCases
Bug: 393471251
Change-Id: I1cc626ba281939999a7d6978668eefea8531ffec

Junyu Lai   commited 2025-05-15 15:04:24 +08:00
a8f2ea5b37
Merge "add new host_common_data tag in addition to host_required" into main
Julien Desprez   authored and   Android (Google) Code Review   commited 2025-05-14 20:05:03 -07:00
0476e06f2a
add new host_common_data tag in addition to host_required
This enables the proper packaging of the dependency along with the test module rather than maintaining a manual mapping the CI infrastructure. The new field introduced in Soong is the right field to properly declare  a host side dependency for a device-test (b/262397555)

Test: presubmit
Bug: 413525819
Flag: TEST_ONLY
Change-Id: If103e32632e4312460d99abd2a5c5b00e877f8ac

Julien Desprez   commited 2025-05-14 20:02:46 -07:00
b7d0a59107
Merge "Add MAC address support for EthernetNetworkSpecifier" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-05-14 19:42:45 -07:00
0047860aff
Merge "Remove deprecated SC_V2 constant" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-05-14 19:33:38 -07:00
9097c4de4a
Merge "DHCPv6 addr reg: parse OPTION_ADDR_REG_ENABLE option." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-14 19:16:54 -07:00
1b2f537953
Merge "DHCPv6 addr reg: add OPTION_ADDR_REG_ENABLE option code." into main
Xiao Ma   authored and   Android (Google) Code Review   commited 2025-05-14 19:12:51 -07:00
a2aaa0bd87
Merge "Remove v1 compatibility version" into main
Thiébaud Weksteen   authored and   Android (Google) Code Review   commited 2025-05-14 18:15:32 -07:00
2db104423d
Add MAC address support for EthernetNetworkSpecifier
This patch adds MAC address support for EthernetNetworkSpecifier under
@hide flag.
After adding the support, EthernetNetworkSpecifier will be able to be
matched by MAC address in addition to existing interface name match. The
specifier can be satisfied with either MAC address and/or interface
name.

Bug: 397536853
Test: atest CtsNetTestCases:android.net.cts.EthernetNetworkSpecifierTest
Flag: EXEMPT mainline

Change-Id: Ibe55411ad0d3fdded6e25c9f33d9898e3eab3a3c

Chuwei He   commited 2025-05-14 18:10:02 -07:00
4259f55ef1
DHCPv6 addr reg: parse OPTION_ADDR_REG_ENABLE option.
Check if the received DHCPv6 message has included this option, if so,
that indicates the DHCPv6 server supports the address registration.

Flag: EXEMPT guarded by an legacy experiment flag
Bug: 293393743
Test: TH
Change-Id: I04370b58e26c09ef764d92d3e211b9619b528cf0

Xiao Ma   commited 2025-05-14 17:32:01 -07:00
f3aa20f112
Don't ignore exceptions in NsdManagerDownstreamTetheringTest
tryTest{} catches and returns and must be ended with a cleanup{}
block to throw. That is why it's marked with @CheckReturnValue.
The IDE marks the entire block as a huge warning.

Ideally this should really be an error, but that flag only exists
in Kotlin 2.2 and above, which is not out of beta yet, so
add a TODO in the bp file

Test: NsdManagerDownstreamTetheringTest
Flag: EXEMPT test-only
Change-Id: I62a9d0a16926574eb286d45b61d4d5d2e8c870ab

Chalard Jean   commited 2025-05-15 09:04:02 +09:00
ebaef1230b
Don't warn in tests for deprecation
This change removes hundreds of lines of useless warnings, since
tests must check the continued working of old and deprecated methods.

Test: build manually and observe the warnings are gone
Flag: EXEMPT test-only
Change-Id: Ie50b2f35b09041e8e201b30b1e575e66e045bc44

Chalard Jean   commited 2025-05-15 09:04:02 +09:00
87df372535
Remove deprecated SC_V2 constant
Test: TH
Flag: EXEMPT test-only
Change-Id: I3444fad305f49294ed8c3a850b631f385678c117

Chalard Jean   commited 2025-05-15 09:03:59 +09:00
9373e3442e
Backfill new field host_commong_data
This new field ensures that the dependence is properly packaged with the module.
(original context: b/262397555)

Test: presubmit
Bug: 413525819
Flag: TEST_ONLY
Change-Id: Ifca931a4ee7fa671f2316ae731b207404a8edd3d

Julien Desprez   commited 2025-05-14 13:23:36 -07:00
33b48e47c6
Enable REQUEST_RESTRICTED_WIFI and CARRIER_SERVICE_CHANGED_USE_CALLBACK by default with kill switch
Bug: 416044405

Test: atest ConnectivityManagerTest
      atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.ConnectivityServiceTest
Change-Id: I1b67c00ce3d4054414ce9c538ec4d7b9a55b4302
Flag: com.android.net.flags.request_restricted_wifi

Ying Xu   commited 2025-05-14 10:56:45 -07:00
7e4e0952f8
Merge "Change creation methods in RtNetlinkLinkMessage to take index(1/2)" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-05-14 00:15:03 -07:00
38f66bdf9b
DHCPv6 addr reg: add OPTION_ADDR_REG_ENABLE option code.
Flag: EXEMPT define an option code constant
Bug: 293393743
Test: TH
Change-Id: Ib8b33b3c8ef9c568e1e0ef3b7f84d716ae53f130

Xiao Ma   commited 2025-05-14 15:46:19 +09:00
9ace2bc8d1
Remove v1 compatibility version
This version is deprecated, only download the latest version. Keep the
array in place to easily add the next version in the future.

Bug: 409884646
Test: atest NetworkSecurityUnitTests
Flag: EXEMPT bug fix
Change-Id: Ia367c0c796ba56a470edcbfa0bc93213c4829d3f

Thiébaud Weksteen   commited 2025-05-14 13:18:27 +10:00
0978c3207e
Merge "NetBpfLoad: (noop) simplify /sys/fs/bpf dir creation" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-13 17:15:48 -07:00
cdb2f5a76c
Merge "Disallow the legacy tether API for Wi-Fi." into main
Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-13 16:59:38 -07:00
61b1008d0f
Merge "Add unit test for filteredClone." into main
Richard Uhler   authored and   Android (Google) Code Review   commited 2025-05-13 13:02:06 -07:00
918c8e490f
Inline getServedUsbType
To improve readability. Renames the forNcmFunction parameter to isNcm to
make it all fit on a single line.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Iafebc4398aaf061175c4f84c45b37975940ca587

Patrick Rohr   commited 2025-05-13 05:09:06 -07:00
0cbf4b2b56
Merge "Ignore calls to tether() where the interface type is invalid." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-13 04:37:59 -07:00
66115db275
Disallow the legacy tether API for Wi-Fi.
AOSP code has never used this API, and metrics from production
show no usage either. Removing it will allow simplifying the
code.

This CL removes testRequestStaticIpLegacyTether because it makes
legacyTether a no-op and there is already a test for static IP
request right above it.

Bug: 408087033
Flag: EXEMPT dead code
Test: updated existing tests
Change-Id: Ib94ed0860ab57abfd9fc7bdfdc911f5ab57003ed

Lorenzo Colitti   commited 2025-05-13 19:43:58 +09:00
bec4b5b8d4
Ignore calls to tether() where the interface type is invalid.
It looks like the code was already trying to ignore this (it
reported an error to the caller), but it then continued on to
create a request and call tetherInternal on it. This is still a
no-op because the code will never create an IpServer for an
interface that has type INVALID: IpServers are only ever created
in ensureIpServerStartedForType, and the only callers are:

- ensureIpServerStartedForInterface, which returns early if the
  type is INVALID.
- enableIpServing:
  - enableWifiP2pIpServing: returns early if type is INVALID
  - enableWifiIpServing: returns early if type is INVALID
  - enableUsbIpServing: can only pass in USB or NCM
  - BluetoothCallback#onAvailable: passes in BLUETOOTH
  - EthernetCallback#onAvailable: passes in ETHERNET
  - setVirtualMachineTethering: only called with VIRTUAL
  - StartTetheringSoftApCallback#onStateChanged: passes in the
    request previously passed to it by setWifiTethering, which
    is always WIFI.

Bug: 408087033
Test: covered by existing tests
Flag: EXEMPT dead code
Change-Id: I8ebba3edde93677c54488803fe4b573d78ad25a9

Lorenzo Colitti   commited 2025-05-13 18:56:31 +09:00
81cdc02a63
NetBpfLoad: (noop) simplify /sys/fs/bpf dir creation
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Iee3b3a82d3ecb233956cedb2f81a591eed43dc69

Maciej Żenczykowski   commited 2025-05-13 01:59:07 -07:00
57de4bfef0
Merge "Fix IPv4 link-local, default routes network guess" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-12 21:17:59 -07:00
bff79be55a
Change creation methods in RtNetlinkLinkMessage to take index(1/2)
Currently methods to create netlink message in RtNetlinkLinkMessage
take interface name, while interface index is a more deterministic way
to define an interface.

This patch changes these methods from taking interface name to taking
interface index.

Bug: 404378068
Test: NetworkStaticLibTests
Flag: EXEMPT mainline
Change-Id: I0754ee53eb0160e67f24e36340abf91b1e87d0e7

Chuwei He   commited 2025-05-13 12:06:54 +09:00
b1110454bb
Fix IPv4 link-local, default routes network guess
Inet4Address#isLinkLocalAddress can also return true if the address is
in the 169.254.0.0/16 range.

The code should also only consider directly-connected routes for
guessing, as default routes would match any address.

This is not used in platform code. This code path is only used when the
mDNS stack is used as a library.

Bug: 415483522
Test: atest
Flag: EXEMPT dead code in the platform
Change-Id: I53d8ad7f96368d4609b1baa804cd75aa65628c0c

Remi NGUYEN VAN   commited 2025-05-13 11:36:00 +09:00
5453629266
Merge "Revert "Set the owners to look at the same branch not to be fixed to main."" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-12 11:07:01 -07:00
8baa85d1ca