Commit graph

111,650 commits

Message SHA1
NetBpfLoad: less copies
This is a cherry-pick of ag/34620709 to NetBpfLoad

Test: TH
Flag: EXEMPT no-op
Bug: 428792764
Change-Id: Ia5aaa30cab71a2051b6c787824798958f2dee3f5

Motomu Utsumi   commited 2025-07-17 08:49:51 -07:00
1ae10a006e
Fix EthernetManagerTest
This patch fixes EthernetManagerTest as follows:
(1) testEnableDisableInterface_disableEnableEthernet
    Fix the test error when USB interface is present and treated as
    ethernet interfaces.
(2) testRemoveInterface_disableEnableEthernet
    Fix the error When tethering interface already presents.

Bug: 427055553
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline

Change-Id: I2a31f3f0434b35e9ebe96b4f7003e5a9be0d3e81

Chuwei He   commited 2025-07-17 14:50:26 +09:00
e9dcc62d2d
Merge changes I332c8d43,I340bcb77 into main
* changes:
  Simplify APF IGMPv3 general query offload test
  refactor: Lazy load IP addresses for APF tests

Jimi Chen   authored and   Android (Google) Code Review   commited 2025-07-16 07:38:59 -07:00
5904ce1431
Simplify APF IGMPv3 general query offload test
Reduce the number of multicast addresses used in
`test_igmpv3_general_query_offload` to simplify the test case and
focus on the core functionality.

Flag: EXEMPT mainline
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I332c8d43bd89a444728ed7ebde3f4e064e4e39aa

Jimi Chen   commited 2025-07-16 04:31:44 +00:00
e42fb901b9
refactor: Lazy load IP addresses for APF tests
Previously, IPv4 and IPv6 addresses were retrieved in `ApfTestBase.setup_class`,
which meant all APF tests assumed the presence of both.

This change refactors `ApfTestBase` to introduce dedicated methods:
- `get_and_expect_ipv4_addresses_exist()`
- `get_and_expect_ipv6_addresses_exist()`

These methods now handle the retrieval and assertion of IP addresses.
Individual test cases in `ApfV6Test` are updated to call these methods
only when the respective address type is required for the specific test
scenario.

This improves test robustness by ensuring tests only depend on the
necessary IP addresses, allowing for more precise test setup and failure
reporting. Additionally, the doze mode activation is reordered to occur
after initial network setup.

Flag: EXEMPT mainline
Bug: 419427388
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV6Test
Change-Id: I340bcb77fe66cc9927dcd58e5899cdf9a4375daa

Jimi Chen   commited 2025-07-16 04:31:40 +00:00
419e088796
Merge "Ignore RtNetlinkMessage with null or empty interface names" into main
Chuwei He   authored and   Android (Google) Code Review   commited 2025-07-15 20:47:39 -07:00
27013988a7
Merge "Add metrics for QUIC connection close" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-07-15 20:32:42 -07:00
e5d4a0fca3
Merge "NetBpfLoad: don't print multiline log_buf on user builds" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 20:05:23 -07:00
0298e7f4b7
Merge "bpf: remove zero uid hack" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 20:05:22 -07:00
792f685d65
Merge changes I9114d27c,I8e8f62ed into main
* changes:
  bpf: rename 'maps' section to '.android_maps'
  NetBpfLoad: remove support for .o wide bpfloader_{min,max}_ver

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 20:05:20 -07:00
ef77e34e39
Merge "bpf: remove size_of_bpf_{map,prog}_def" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 19:39:44 -07:00
0c01e5f0a8
Ignore RtNetlinkMessage with null or empty interface names
This patch checks if interface name is null or empty for
RtNetlinkMessage and ignores the message if it is.

Bug: 429497348
Test: build
Flag: EXEMPT bugfix
Change-Id: I6000f5442f341f152b7fbd235affded0fa56fe50

Chuwei He   commited 2025-07-15 18:43:07 -07:00
16c8fd1166
Merge "Disconnect a network if it's suspended for 5 minutes for wear" into main
Hongyi Zhang   authored and   Android (Google) Code Review   commited 2025-07-15 18:09:56 -07:00
29ae4e7b43
NetBpfLoad: don't print multiline log_buf on user builds
These tend to be huge (because they can contain the full bpf disassembly)
but not very worthwhile, because they often result in logs being rate
limitted, and thus we miss out on the useful information.

This is particularly true for user builds on non-Google devices
installing the production signed tethering apex mainline module.

We're better off seeing more of the other log lines...

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

Maciej Żenczykowski   commited 2025-07-15 15:00:25 -07:00
f125992b27
bpf: remove zero uid hack
Not needed any more, since no more loader vs .o version skew.

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

Maciej Żenczykowski   commited 2025-07-15 14:46:10 -07:00
cb0433611e
bpf: rename 'maps' section to '.android_maps'
For libbpf compatibility we will want to have a 'normal' looking
.maps section & an android-only .android_maps section.

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

Maciej Żenczykowski   commited 2025-07-15 14:43:49 -07:00
b27d2137d6
NetBpfLoad: remove support for .o wide bpfloader_{min,max}_ver
This is not needed, as this is now simply hard coded (along with the
.o names themselves) inside of NetBpfLoad.cpp itself - see loadAllObjects().

Even if it wasn't, we're better off using the per-map & per-program
limits instead.  These will already cause all maps/programs to be skipped...

(The only reason to have a global per .o one was to solve
.o vs loader version skew issues, which we can no longer have)

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

Maciej Żenczykowski   commited 2025-07-15 14:40:11 -07:00
c4a1cae939
bpf: remove size_of_bpf_{map,prog}_def
No longer needed, since there is no longer any possibility of .o vs loader version skew.

'git grep size_of_bpf_' finds nothing

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

Maciej Żenczykowski   commited 2025-07-15 14:28:59 -07:00
b345ffb23d
Merge changes Ie9ccb374,I3cf8ae1c,Ie8026c51 into main
* changes:
  bpf/progs/netd.h: use defines for some map SIZE constants
  bpf/progs/netd: remove DATA_SAVER_ENABLED_MAP_SIZE constant
  bpf/progs/netd: remove some constants

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 13:57:05 -07:00
d3fb5d7137
Merge "bpf/progs/netd.h: remove obsolete comment" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-15 13:54:45 -07:00
d44038be18
Merge "Prepare to move VCN: Add visibilities for tests" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-15 13:09:27 -07:00
a5b6808587
bpf/progs/netd.h: use defines for some map SIZE constants
This is better for libbpf...

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

Maciej Żenczykowski   commited 2025-07-15 12:24:16 -07:00
2175105039
bpf/progs/netd: remove DATA_SAVER_ENABLED_MAP_SIZE constant
(only needed by test, but this is really just a single boolean)

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

Maciej Żenczykowski   commited 2025-07-15 12:20:24 -07:00
00c01a6e8f
bpf/progs/netd: remove some constants
These aren't used anywhere else, furthermore switching to libbpf
would require these to become #define's.

Let's just hard code them instead.

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

Maciej Żenczykowski   commited 2025-07-15 12:20:16 -07:00
5bbc1d73f0
bpf/progs/netd.h: remove obsolete comment
We haven't done a good job of keeping this comment relevant...
might as well just delete it.

Test: N/A
Flag: EXEMPT mainline / comment only
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia822ce214cf3d35e10c71f0fe84280a354b1b8c0

Maciej Żenczykowski   commited 2025-07-15 12:15:18 -07:00
a5c7c58e0a
Merge "Prepare to move VCN: Define utility lib for framework VCN" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-15 11:34:09 -07:00
1867ae1471
Disconnect a network if it's suspended for 5 minutes for wear
The suspension state is designed to be a transient state. Implement an
enforcement to disconnect the network after staying at this state for 5
minutes. This can avoid apps unnecessarily waking up the device for
network activities even when there's no network actually connected.

Test: unit tests. Locally tested with a signal blocking bag.
Bug: 404570281
Flag: EXEMPT mainline
Change-Id: I1427a72402f7ec64eda537a89c86768466a72328

Hongyi Zhang   commited 2025-07-15 09:39:37 -07:00
3dcb3c5890
Add metrics for QUIC connection close
Test: QuicConnectionCloserTest
Flag: EXEMPT mainline
Bug: 311792075
Change-Id: I2bd9108c1f8af89824bf48767fcca9a1e1d57831

Motomu Utsumi   commited 2025-07-15 17:10:56 +09:00
504fe27b86
Merge "Pass bluetoothUseRandomAddress via RoutingCoordinator constructor" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-07-14 22:47:19 -07:00
1cdb0a5609
Merge "Store filter replies info in ListenerInfo" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-14 21:40:13 -07:00
7525976e12
Merge "Search for the satellite opt-in flag in disabled services" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-14 20:41:48 -07:00
c5cda84789
Merge "Revert^2 "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"" into main
Jimi Chen   authored and   Android (Google) Code Review   commited 2025-07-14 20:15:39 -07:00
46115b3d07
Pass bluetoothUseRandomAddress via RoutingCoordinator constructor
This refactoring changes how the bluetoothUseRandomAddress flag is
accessed.

PrivateAddressCoordinator is in a library used by multiple mainline
modules(Tethering, NetworkStack, CaptivePortal, WiFi) and cannot
directly read a Tethering mainline beta flag.

To fix this, the flag's value is now passed down through constructors.

An alternative solution would be to split the Java library for each module,
but with this solution, a single utility class cannot be shared.

This commit is a no-op as the passed value is hardcoded to false.

Test: TH
Flag: EXEMPT refactor
Bug: 287177081
Change-Id: I5f2174ee94b55e7a7298b9742221d6e6c3c5cac5

Motomu Utsumi   commited 2025-07-15 11:20:01 +09:00
323d22a497
Merge "Remove wrong comment" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-14 18:56:54 -07:00
4bf572734a
Merge "Ignore null or empty interface names in EthernetTracker." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-14 18:36:27 -07:00
28e3c12b24
Remove wrong comment
Test: TH
Flag: EXEMPT comment only change
Change-Id: Ifba2528aaa9bfb1ecdd982462f451d92bbd85cf2

Yuyang Huang   commited 2025-07-14 08:56:35 -07:00
75cf08972f
Merge "Revert^2 "Implement opt-in to custom tabs in captive portals."" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-07-14 08:47:48 -07:00
78c97d631c
Revert^2 "Implement opt-in to custom tabs in captive portals."
This reverts commit 5177b0b6b4.

Reason for revert: try again

Change-Id: I2832861643e4c5ab41b5d857e210f1fd9bf62a69

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 23:47:42 -07:00
569563cb08
Merge "Revert "Implement opt-in to custom tabs in captive portals."" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 22:24:05 -07:00
39a1805fe5
Revert "Implement opt-in to custom tabs in captive portals."
This reverts commit f2cb190a73.

Reason for revert: This is the integration test CL, it will break due to ag/34545776 reverted.

Change-Id: I5fc66fab409989479078dfcffea7793b9d6dd749

Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 22:23:21 -07:00
5177b0b6b4
Revert^2 "Fix onActiveDataSubscriptionIdChanged is not received in multi SIM mode"
This reverts commit 1bcbb88955.

Reason for revert: fix TelephonyCallback in multi SIM mode

Bug: 430233890
Change-Id: Ibfdc5546083132c504ac129256f321dd000b890c

Jimi Chen   commited 2025-07-13 20:05:43 -07:00
b588948892
Merge "Implement opt-in to custom tabs in captive portals." into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-13 03:24:56 -07:00
c0ad26d21b
Merge "bpf/progs/netd.c - hackery for old clang" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-07-11 14:23:06 -07:00
5b94304a34
Implement opt-in to custom tabs in captive portals.
This will allow portal operators to opt-in to custom tabs in
captive portal, either across the board with "true" or with
a version of the module above which it wants to opt-in.

Ideally there could be a separate key to also list opted-in
browsers and their versions, but this would become a lot
more complex. To start with, there is no place in
CaptivePortalData to store this kind of info, and that would
mean adding API which would have to be supported forever.

The constant inside the source represents a capport source that
contains the custom tabs opt-in. This is not a great place to put
this information in, but it has the characteristics of a benign and
useful hack :
- Time to market is 0
- It's easy to remove once we have a better API
- It's not a large problem if it's never cleaned up

Also, allowing to choose the browsers and the versions would
be uncomfortable since the choice of the browser is the user's
choice. On the one hand it does make some sense that the
operator could test with a given browser, see the UX is not
well adapted, and reject it, but on the other hand giving the
operator the choice of what browser the user can choose to
use on their portal is disputable, as this should generally be
under the control of the user.

In any case even if we decided to add a per-browser version
check it should be done in some other change.

Test: manual
Flag: EXEMPT opt-in feature
Change-Id: I540f4fcb6fb26f7f18077d9c8d06e5f7df206056

Chalard Jean   commited 2025-07-11 15:03:51 +09:00
f2cb190a73
Merge "Add UID to NSD metrics" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-07-10 17:38:22 -07:00
3fc71d986b
Prepare to move VCN: Add visibilities for tests
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.

Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01

Yan Yan   commited 2025-07-10 20:47:00 +00:00
e82942e7c5
Prepare to move VCN: Define utility lib for framework VCN
This is a preparation CL before moving VCN code from frameworks/base
to p/m/Connectivity/

This CL defines a utility lib so that the VCN framework code can
use HexDump. With HexDump, VCN will define another lib for the IPsec
module.

Bug: 379938062
Flag: EXEMPT; pure refactoring
Test: FrameworksIkeTests, CtsIkeTestCases
Change-Id: I9bc8b37779315841c2a93328942d073b6bf40808

Yan Yan   commited 2025-07-10 20:46:41 +00:00
aa2f53143e
Merge "Prepare to move VCN: Add visibilities" into main
Yan Yan   authored and   Android (Google) Code Review   commited 2025-07-10 10:25:00 -07:00
9fc98e3318
Merge "Refactor: Add RestoreEthernetRule for ethernet tests" into main
Junyu Lai   authored and   Android (Google) Code Review   commited 2025-07-10 03:58:40 -07:00
f693a0f9bf
Refactor: Add RestoreEthernetRule for ethernet tests
This is a no-op, test only refactoring.
Move ethernet state management logic from EthernetManagerTest into a
dedicated JUnit test rule, RestoreEthernetRule. This new rule is
responsible for saving the initial ethernet state, allowing tests to
enable or disable it, and restoring the original state upon test
completion.  This refactoring simplifies EthernetManagerTest and
promotes code reuse.

Flag: EXEMPT EXEMPT test only refacotring
Test: atest NetworkStaticLibTests:com.android.testutils.RestoreEthernetRuleTest \
      CtsNetTestCases:android.net.cts.EthernetManagerTest --update-device
Bug: 410731080
Change-Id: If3dd869d6af4e0c659386621fb5d92012aa574d1

Junyu Lai   commited 2025-07-10 15:25:15 +08:00
9f6a566d89