Log.wtf implies a catastrophic, unrecoverable failure. Failures to read
procfs files (e.g., due to permissions or non-existence) are better
represented by Log.e as they are often recoverable or expected under
certain conditions, and not always indicative of a fatal application state.
Flag: EXEMPT mainline
Bug: 429012888
Test: TH
Change-Id: I717d46d4c3802ac478e80d2a9dd28c79a9ebc5f7
The previous runAsShell calls adopted permissions spuriously. This
change fixes runAsShell to consistently adopt the correct permission
for the respective API call.
Also calls setEthernetEnabled() no matter what the current state is at
the end of the test (as there is no harm in doing so).
Test: TH
Flag: EXEMPT mainline
Change-Id: Ib11b889148213b160567cf0a3b9ea72b5b0c851e
This reverts commit f28878b120.
Reason for revert: The original change was incompatible with
ag/34622357. Reapplying the fixed CL.
Bug: 432497516
Change-Id: I1b19b3336a4c938ef1adbd12c50a11903d373194
This is a no-op because the data in the ".android_maps"/"progs" section
is an array of struct bpf_map_def/bpf_prog_def.
Test: TH
Flag: EXEMPT no-op
Bug: 428792764
Change-Id: I80bd8c72c68b5359cf1b16ed5d4739a854169d7f
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
The previous changes to move EthernetStateListener and
InterfaceStateListener introduced 2 separate ArrayTrackRecords. This
test explicitly uses a single TrackRecord for both callbacks, so their
respective ordering can be tested.
This change resets EthernetManagerTest to the last known good state
(57fdd00cc7).
Test: TH
Flag: EXEMPT mainline
Change-Id: I3f61b474ff900ff44a366ed3ebd20f4d83f6bf7b
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
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
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
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 Żenczykowskicommited 2025-07-15 15:00:25 -07:00
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 Żenczykowskicommited 2025-07-15 14:46:10 -07:00
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 Żenczykowskicommited 2025-07-15 14:43:49 -07:00
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 Żenczykowskicommited 2025-07-15 14:40:11 -07:00
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 Żenczykowskicommited 2025-07-15 14:28:59 -07:00
* 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 Robotauthored and Android (Google) Code Reviewcommited 2025-07-15 13:57:05 -07:00
This is better for libbpf...
Test: TreeHugger
Flag: EXEMPT mainline / comment only
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie9ccb37498b89e638fba1e48535d1108536080f1
Maciej Żenczykowskicommited 2025-07-15 12:24:16 -07:00
(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 Żenczykowskicommited 2025-07-15 12:20:24 -07:00
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 Żenczykowskicommited 2025-07-15 12:20:16 -07:00
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 Żenczykowskicommited 2025-07-15 12:15:18 -07:00
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
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