-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaS5huQAKCRDorT+BmrEO
eIsnAJ9kJ9OjiHpwigt9XwjTrGcbD1hQ0QCfSw2VHyS9TLyzt7DZsQ3AYU+WVVA=
=/SH/
-----END PGP SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgPpdpjxPACTIhnlvYz0GM4BR7FJ
+rYv3jMbfxNKD3JvcAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQHUBff/oLA1TO7KbbZDsBJZmFVcXgFmG+2K3aaKq9F0tiaT1kiNeHdjXpaLI07p344
TExz9CBvFVft81pJyRBwY=
-----END SSH SIGNATURE-----
Merge tag 'android-16.0.0_r4' into staging/lineage-23.2_merge-android-16.0.0_r4
Android 16.0.0 release 4
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaS5huQAKCRDorT+BmrEO
# eIsnAJ9kJ9OjiHpwigt9XwjTrGcbD1hQ0QCfSw2VHyS9TLyzt7DZsQ3AYU+WVVA=
# =/SH/
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue Dec 2 05:49:13 2025 EET
# gpg: using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [ultimate]
# By Yan Yan (203) and others
# Via Automerger Merge Worker (1173) and others
* tag 'android-16.0.0_r4': (1057 commits)
Use string for CREATE_APP_SPECIFIC_NETWORK permission
bpf: move MSS calculation under CE check to avoid overhead
BpfNetworkStats: use `atomic` for ifindex cache when possible
NetBpfLoad: remove pointless 0 write.
bpf: remove obsolete isAtLeastR/Sv2/25Q3
NetBpfLoad: use global `api_level_full` directly in NetBpfLoad
Log validated underlying network count that's available for VCN underlying network selection
BpfUtils: fix sdk level detection logic for 25Q3+
Add RTMGRP_IPV6_IFINFO
bpf: remove BPFLOADER_MAINLINE_U_QPR3_VERSION
bpf: move BPFLOADER_MAINLINE_S_VERSION into bpf_map_def.h
Reduce log level for BluetoothSocket errors
Bump the min sdk of Tethering
BpfNetworkStats: apparently RiscV isn't actually a 64-bit architecture.
KernelUtils.h: isAtLeastKernelVersion(x,y,z) - default 'z' to 0
bpf_existence_test - update for tcp acc ecn
bpf: tcpAccECN: eliminate header file and move more fully into netd
BpfMap: shorten error strings to enable SSO (on 64-bit)
BpfNetworkStats: enforce that IfaceValue access is lock-free
NetBpfLoad: use libbpf based on mainline beta flag, part 2
...
Conflicts:
bpf/headers/include/bpf/KernelUtils.h
bpf/progs/netd.h
Change-Id: I76a7aadc1405c6621e17f3d1b6b87640d84f5794
-----BEGIN PGP SIGNATURE-----
iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaRO/HAAKCRDorT+BmrEO
eOs9AJ9Yzz2HpDR3pyRIXhvl4k7bNABGvgCeMg5sU16s0CkFIDbZmOsSo4fswZQ=
=1o5/
-----END PGP SIGNATURE-----
gpgsig -----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgPpdpjxPACTIhnlvYz0GM4BR7FJ
+rYv3jMbfxNKD3JvcAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQIRFF5B6T8EGhzDN+1dhvomEkctFjdVr5DZnhgnEIvcCEuzO36RzY3DBG9AIL+EejJ
Z1zz7uAapzWUsyFpbYAQM=
-----END SSH SIGNATURE-----
Merge tag 'android-16.0.0_r3' into staging/lineage-23.0_merge-android-16.0.0_r3
Android 16.0.0 Release 3 (BP3A.250905.014)
# -----BEGIN PGP SIGNATURE-----
#
# iF0EABECAB0WIQRDQNE1cO+UXoOBCWTorT+BmrEOeAUCaRO/HAAKCRDorT+BmrEO
# eOs9AJ9Yzz2HpDR3pyRIXhvl4k7bNABGvgCeMg5sU16s0CkFIDbZmOsSo4fswZQ=
# =1o5/
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed Nov 12 00:56:28 2025 EET
# gpg: using DSA key 4340D13570EF945E83810964E8AD3F819AB10E78
# gpg: Good signature from "The Android Open Source Project <initial-contribution@android.com>" [ultimate]
# By Patrick Rohr (91) and others
# Via Android (Google) Code Review (233) and others
* tag 'android-16.0.0_r3': (377 commits)
Fix netbpfload version info.
NetBpfLoad: add self-check for bpfGetNext{Prog,Map}Id()
Add NetworkTemplate get/set transport type methods
Pass EthernetPort to EthernetNetworkFactory#updateInterfaceLinkState
Pass EthernetPort to updateInterfaceState
Remove spurious VisibleForTesting and change visibility to public
Pass EthernetPort to EthernetNetworkFactory#removeInterface
Pass EthernetPort to removeInterface
Pass EthernetPort to stopTrackingInterface
Add getEthernetPorts and use it in getAllInterfaces
Rename getClientModeInterfaces to getClientModeInterfacesSorted
Rename getAvailableInterfaces to getInterfacesSorted
Pass EthernetPort into NetworkInterfaceState
Pass EthernetPort into EthernetNetworkFactory#addInterface
Use multicast socket for group membership
Test refactoring of DefaultNetworkRematchMetrics
Fix SatisfiedTime initialization
DHCPv6 addr reg: parse IA Address option.
Pass EthernetPort to addInterface
Change tethering interface to EthernetPort
...
Conflicts:
bpf/progs/netd.c
service/src/com/android/server/ConnectivityService.java
staticlibs/testutils/host/python/apf_test_base.py
tests/cts/multidevices/apfv4_test.py
tests/cts/multidevices/apfv6_test.py
tests/cts/multidevices/run_tests.py
tests/unit/java/com/android/server/connectivityservice/CSNetworkAgentTest.kt
Change-Id: Ifedf92aee90cbcc55ef8f9652de8b5faff1c30d9
This allows using the permission in 25Q4 before it becomes a
public API in 26Q2.
Flag: android.net.platform.flags.create_app_specific_network_permission
Test: TH
Bug: 435313135
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:60f7743f773b05a98e651c953631e93957291bf5
Merged-In: I8d336a588eddf9a027079e208b2b96bb6c163e86
Change-Id: I8d336a588eddf9a027079e208b2b96bb6c163e86
Motomu Utsumiauthored and Android Build Coastguard Workercommited 2025-09-30 03:56:13 -07:00
If the PAN service disconnects before the BT iface is available, the BT
TetheringRequest will be stuck pending and prevent any new BT
startTethering attempts. This may happen if the user turns BT tethering
on and turns off BT without connecting to any device.
Fix this by always removing the pending BT request when the PAN service
disconnects.
Flag: EXEMPT minor bugfix
Bug: 420412916
Test: atest TetheringTest, manually verify turning BT tethering on,
turning off BT, and turning BT tethering on again.
Change-Id: I6bc96d6e4016d83af6cfd8e549d474ce651a44fc
Quang Anh Luongauthored and Bharathcommited 2025-09-25 22:18:38 +05:30
System server | Client (e.g. phone)
------------------------------|-----------------------------
|
NetworkAgentMessageHandler ←--|--- INetworkAgentRegistry
↓ | ↑
| NetworkAgent
NetworkAgentInfo | ↑
↓ | NetworkAgentHandler
| ↑
INetworkAgent ---|--→ NetworkAgentBinder
The simplest artifact is observed by watching the output of
adb shell dumpsys meminfo -d phone | grep 'Proxy Binders'
while turning airplane mode on and off (slowly, to allow the
cell network to connect and disconnect).
This will display the number of binder proxies. Before this, the binder
proxy count increases by 2 with each connection and never goes down (there
is some noise, as proxy objects are sometimes created for other reasons,
and get GC'd eventually). After this, the binder proxy count is always
eventually stable.
Also see b/133174607.
Bug: 400358935
Flag: EXEMPT bugfix
Test: manual, also regression test on the way
Change-Id: I1dcdaec1f3bd42bc2a406c9e9318208f96266bd6
Chalard Jeanauthored and Bharathcommited 2025-09-25 21:18:59 +05:30
Currently, the MSS-based packet count calculation is performed for
every packet, regardless of whether the IP ECN field indicates CE
(congestion experienced). Since the computed value is only used
when CE is set, this results in unnecessary per-packet processing.
Move the MSS calculation inside the ip_ecn == 0b11 condition so
that it is only executed when a CE mark is actually present. This
reduces overhead on the fast path while preserving correct CE
accounting.
No functional change in CE handling, only an optimization in
execution flow.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Sandeep <irlanki.s@samsung.corp-partner.google.com>
Change-Id: I5cae40f914473d9f914c826d50dd91c93e047ccc
Sandeepauthored and Maciej Żenczykowskicommited 2025-09-15 02:07:44 -07:00
We no longer support mainline on R,
hence checks for R are not required.
We don't want any S vs Sv2 and 25Q2 vs 25Q3 differentiation.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I746b404520ccb12fddf02c6956d7cf1824f21bbd
Maciej Żenczykowskicommited 2025-09-13 03:28:18 -07:00
This change removes the `bpfloader_ver` parameter from several internal functions and replaces its usage with the global `api_level_full` variable, simplifying function signatures.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6165e525d7aa49fbd7d12be0c3ea85015cfc6f3d
Maciej Żenczykowskicommited 2025-09-13 01:57:50 -07:00
This is needed to receive IF_RA_MANAGED and IF_RA_OTHERCONF
notifications from netlink.
See inet6_ifinfo_notify() in addrconf.c.
Test: TH
Flag: NONE yes
Change-Id: I525eef4eb305c08aa2480e91321ea5fd514d4d65
This is not used, and it seems unlikely we would ever
want to differentiate based on this.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ab48e0e4dc7a8979a34509ebc3d901a0bce3840
Maciej Żenczykowskicommited 2025-09-12 12:07:08 -07:00
also while at it renumber things so that in the future
we can autoderive the version from full api level.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie12638a3dcbde9db3e50d1736efa37154b22341c
Maciej Żenczykowskicommited 2025-09-12 12:06:45 -07:00
This exception is also logged when the other side disconnects gracefully
(because there is no way to distinguish this case using the Bluetooth
APIs). This change reduces the log level to a warning because it is
almost always a red herring.
Test: TH
Flag: NONE yes
Change-Id: I94f20be91ff8481fdd1a50fbbc27200c57885426
This is required because we are bumping the min sdk of NetworkStack
which this depends on.
Test: build locally + aapt2 dump badging
Bug: 444168252
Flag: build.RELEASE_DEPRECATE_MAINLINE_R_SUPPORT
Change-Id: Idbff03cdcca9955a4759c19866895f755abedaaf
I'll follow up with some sort of VTS test to block
RiscV until the compiler/language/libraries etc
can support something like CMPXCHG16B or ldp
Bug: 444697997
Flag: EXEMPT BUGFIX
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I553cffe3c4181842c38baf37258262e7b43b9ca4
Maciej Żenczykowskicommited 2025-09-12 11:16:29 -07:00
This seems to be the most common usecase.
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2de4d067b2f20680539cbddb31555864bcf957b1
Maciej Żenczykowskicommited 2025-09-12 10:14:12 -07:00
(also tested with a hack to make isAtLeast26Q2 true)
Test: TreeHugger
Flag: EXEMPT TEST_ONLY
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id1ef5b03cdc27b6d74d6b5bd76692186809e9658
Maciej Żenczykowskicommited 2025-09-12 07:29:24 -07:00
This should be a performance improvement, as it avoids both memory
allocation (Short String Optimization fits the strings on the heap)
and string formatting.
Additionally should prevent us from triggering an abort()
on OOM as reported on the linked bug:
F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 (read)
F DEBUG : Cause: null pointer dereference
F DEBUG : backtrace:
F DEBUG : #00 pc 0000000000000000 <unknown>
F DEBUG : #01 pc 000000000001d008 /apex/com.android.tethering/lib64/libbase.so (fmt::v11::vformat(fmt::v11::basic_string_view<char>, fmt::v11::basic_format_args<fmt::v11::context>)+76) (BuildId: d200bca0044b833c9a13a387041b398a)
F DEBUG : #02 pc 0000000000007108 /apex/com.android.tethering/lib64/libcom.android.tethering.dns_helper.so (android::bpf::BpfMapRO<unsigned int, UidOwnerValue>::readValue(unsigned int) const+152) (BuildId: b20b032f10bd31bb44f969cef38dcd99)
F DEBUG : #03 pc 0000000000006ac8 /apex/com.android.tethering/lib64/libcom.android.tethering.dns_helper.so (android::net::DnsBpfHelper::isUidNetworkingBlocked(unsigned int, bool)+748) (BuildId: b20b032f10bd31bb44f969cef38dcd99)
F DEBUG : #04 pc 0000000000008328 /apex/com.android.tethering/lib64/libcom.android.tethering.dns_helper.so (ADnsHelper_isUidNetworkingBlocked.cfi+60) (BuildId: b20b032f10bd31bb44f969cef38dcd99)
F DEBUG : #05 pc 00000000001c43b0 /apex/com.android.resolv/lib64/libnetd_resolv.so (android::net::DnsProxyListener::GetAddrInfoHandler::run()+284) (BuildId: 9f306d9e52c85087c00931289aa2d7cd)
F DEBUG : #06 pc 00000000001bc888 /apex/com.android.resolv/lib64/libnetd_resolv.so (void* android::netdutils::runAndDelete<android::net::DnsProxyListener::Handler>(void*) (.cfi)+332) (BuildId: 9f306d9e52c85087c00931289aa2d7cd)
F DEBUG : #07 pc 0000000000085580 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*) (.__uniq.67847048707805468364044055584648682506)+232) (BuildId: 9ea0fa19fb5cc316f79c79f922c5a7dc)
F DEBUG : #08 pc 0000000000078248 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 9ea0fa19fb5cc316f79c79f922c5a7dc)
Bug: 441416613
Test: TreeHugger
Flag: EXEMPT BUGFIX
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibdae61b0ec67fd77f0be096ff934c8d424ae1e49
Maciej Żenczykowskicommited 2025-09-12 07:12:57 -07:00
Limited to non-32-bit due to build failures on:
cf_gwear_x86-trunk_staging-userdebug
eos-trunk_staging-userdebug
seluna-next-userdebug
seluna-trunk_staging-userdebug
test_suites_x86_64-trunk_staging
test_suites_x86_64-trunk_staging
test_suites_x86_64-trunk_staging_coverage
This is unfortunate, as it likely means those platforms are
inefficient and possibly even buggy.
Test: TreeHugger
Flag: EXEMPT TEST_ONLY
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibf7eaa0707b0ec2e8eb9ac8ee9de8af20b94683b
Maciej Żenczykowskicommited 2025-09-12 07:09:13 -07:00
Disable shared version of libtetheringflags
- since the flags are readonly there is no real content to this,
and it should be statically linked for compile/link time optimization
(which should basically optimize the entire library out)
Use C++ magic to compile time verify the macro and flag are in sync.
The way this works:
constexpr auto useLibBpf = COM_ANDROID_TETHERING_READONLY_FLAGS_USE_LIBBPF;
^ this basically requires the macro to resolve to true/false, so that 'auto' resolves to 'const bool'
static_assert(std::is_same<decltype(useLibBpf), const bool>::value, "useLibBpf must be a boolean.");
^ which we check here
static_assert(useLibBpf == com::android::tethering::readonly:🎏:use_libbpf(), "useLibBpf flag mismatch");
^ and this then requires the macro and flag to be identical *and* compile time known
Test: TreeHugger
Flag: EXEMPT PURE_REFACTOR
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id5cd8c7d91b424765d6f469806434b3e9587f074
Maciej Żenczykowskicommited 2025-09-12 04:04:39 -07:00