Commit graph

110,033 commits

Message SHA1
[automerger skipped] Skip NetworkStatsBinderTest if the binder interface is not accessible. am: c43d56895f -s ours
am skip reason: Merged-In I7b8baa7ab98ce0114541bf1a9568db6f832213b6 with SHA-1 05b57b7724 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3547573

Change-Id: Ia2d417031e4d8fb5f25f02a9ec952c8d27dff27f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Junyu Lai   authored and   Automerger Merge Worker   commited 2025-03-20 18:05:09 -07:00
88668413ea
Merge "Use scapy to generate ARP packet in multi-device test" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2025-03-20 16:58:58 -07:00
4703e17d98
Merge "netbpfload.rc: add a version comment" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-20 16:25:13 -07:00
1af58f3ad7
netbpfload.rc: add a version comment
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifa37bf5e67f5c7ebc57430c272d74a5695e4ac58

Maciej Żenczykowski   commited 2025-03-20 16:24:48 -07:00
7782ab5f67
NetBpfLoad: 25Q2+ enforce 1GiB+ memlock
On at least some kernel versions sufficient memlock
is needed for some [types? larger? preallocated?]
bpf map creation requests to succeed.

(the kernel's bpf subsys ignores CAP_IPC_LOCK)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ia6975e854e6398ee9c56ce836b278b570e17a0f9

Maciej Żenczykowski   commited 2025-03-20 11:54:00 -07:00
ba7a418cab
Merge "Limit default capabilities to Android B+" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 10:15:15 -07:00
54b07a719c
Merge "Release ClientNetworkRequest before marking request unfulfillable" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 09:14:05 -07:00
360536d926
Merge "Revert "Skip multi-device tests instead of abort if device is non-B+ devices"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 06:11:49 -07:00
23cfd04e9b
Use scapy to generate ARP packet in multi-device test
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I30adfe7ca2fef83ed4ef2ea3e5bc2291b9016530

Jimi Chen   commited 2025-03-20 12:25:57 +00:00
f0343a65d1
Revert "Skip multi-device tests instead of abort if device is non-B+ devices"
This reverts commit 372a15220a.

Reason for revert: this is Android B+ CTS and shouldn't be run with previous release, this can help to catch human error.

Change-Id: I867c63511d4f640e07b8317506291de284efcef3

Jimi Chen   commited 2025-03-20 04:33:43 -07:00
a27bbe9eea
Add IPv6 neighbor solicitation offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I97f6a60ddfa3dcaf4aee0ea1db83cc9636031a54

Jimi Chen   commited 2025-03-20 11:14:50 +00:00
8e8bbcabde
Skip Ping6 offload multi-device test on devices with APF ram less than 3000
Test: TH
Change-Id: If17df379d9bec49a5d1c60b73091a77d9f3bb46d

Jimi Chen   commited 2025-03-20 11:14:50 +00:00
c5a9e2e745
Add MLDv2 offload for APFv6 multi-devices tests
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: If07deb3405b889382e938550c7b09f90030f9d31

Jimi Chen   commited 2025-03-20 11:14:46 +00:00
3cc069adea
Merge "[Thread] add missing Thread overlay decl config_thread_border_router_default_enabled" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 01:54:10 -07:00
4b2271398c
Merge "Delay test for APF activation after screen-off" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-20 01:15:04 -07:00
c45f7675df
Merge changes from topic "revert-3548747-TOVIIQGWFJ" into main
* changes:
  Revert "Make iterating over mNetworkAgentInfos safer."
  Revert "Always disconnect agents immediately."
  Revert "Immediately create networks unless chickened out"

ESWAR MAGATAPALLI (xWF)   authored and   Gerrit Code Review   commited 2025-03-20 00:52:25 -07:00
5a3a51eb7a
Delay test for APF activation after screen-off
CTS tests screen-on device in the beginning, but APF is not activated after screen-off in the test setup.
This change adds 3 secs delay to ensure APF activation before test execution.

Bug: 402667362
Test: ./cts-tradefed run cts-on-gsi -m CtsConnectivityMultiDevicesTestCases -t ApfV4Test --shard-count 2
Test: atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: I067ce792b5f89e2f0051933982ebc734607fbf98

Jimi Chen   commited 2025-03-20 00:41:07 -07:00
d9b49c6938
[Thread] add missing Thread overlay decl config_thread_border_router_default_enabled
Bug: 401654864

Change-Id: I45886e094eddf078b36b23757fca17f650fb9420

Kangping Dong   commited 2025-03-20 15:15:00 +08:00
ff28366d9d
Merge "Skip multi-device tests instead of abort if device is non-B+ devices" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:23 -07:00
c049f61372
Merge "Add apf_ram_at_least decorator to restrict multi-device tests to the given minimum apf ram size capable device." into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:15 -07:00
681b11eeac
Merge "Add get exclude all host IPv6 multicast addresses function to apf_utils" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2025-03-19 23:56:06 -07:00
b3add265bc
Skip NetworkStatsBinderTest if the binder interface is not accessible.
Following up from aosp/3313055, the binder interface getUidStats(II)J
is removed from the module. Currently, the test catches
NoSuchMethodException for reflection.
But did not properly skip for NoSuchMethodError which is thrown by
the java runtime when a method was present during compilation is
no longer available.

Test: cts-tradefed run commandAndExit cts -m CtsNetTestCases -t \
     android.net.cts.NetworkStatsBinderTestinderTest
Bug: 378982661
Merged-In: I7b8baa7ab98ce0114541bf1a9568db6f832213b6
Change-Id: I7b8baa7ab98ce0114541bf1a9568db6f832213b6
(cherry picked from commit 05b57b7724)

Junyu Lai   authored and   Samip Garg   commited 2025-03-19 23:53:55 -07:00
c43d56895f
Merge "LocalNet: remove buggy getIpv4MappedAddressBitLen()" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 22:28:59 -07:00
202c848576
Merge "LocalNet: add DNS over TLS exception" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 22:27:17 -07:00
a3926c8b4a
Merge "LocalNetAccessKey - improve toString" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 22:26:09 -07:00
10ad709f3a
LocalNet: remove buggy getIpv4MappedAddressBitLen()
(a) this function returns a constant

(b) this function is utterly misnamed/documented:

an ipv4 mapped address is (like any ipv6 address) 128 bits long

(c) there's not even a guarantee the address is v4 mapped
when it is called

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I35bd84d28feca080152fd0c3d8e7b22835698b38

Maciej Żenczykowski   commited 2025-03-19 22:03:50 -07:00
0c42bc4bef
Merge "[Thread] update the RRO config for OEM Android Border Router guide" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2025-03-19 21:27:26 -07:00
96a0301014
LocalNet: add DNS over TLS exception
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie780a191002f17a8b2b049271bd6c48d9af4c4fd

Maciej Żenczykowski   commited 2025-03-19 21:25:17 -07:00
f236e862a9
LocalNetAccessKey - improve toString
while at it, improve dump to clarify default is true meaning global,
even though you could assume 0/false is the default, and that true means local...

  $ adb shell dumpsys connectivity trafficcontroller </dev/null | grep LocalNetAccess
Before on bluejay (47 is wlan0, 51 is v4-wlan0):
  sLocalNetAccessMap:
    LocalNetAccessKey{lpmBitlen=132, ifIndex=47, remoteAddress=/::ffff:224.0.0.0, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=160, ifIndex=47, remoteAddress=/::ffff:255.255.255.255, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=96, ifIndex=47, remoteAddress=/2a00:79e1:2e00:3f01::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=96, ifIndex=47, remoteAddress=/fe80::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=40, ifIndex=47, remoteAddress=/ff00::, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=132, ifIndex=51, remoteAddress=/::ffff:224.0.0.0, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=160, ifIndex=51, remoteAddress=/::ffff:255.255.255.255, protocol=0, remotePort=0}: false
    LocalNetAccessKey{lpmBitlen=40, ifIndex=51, remoteAddress=/ff00::, protocol=0, remotePort=0}: false
After this commit:
  sLocalNetAccessMap (default is true meaning global):
    LocalNetAccessKey{lpmBitlen=132 ifIndex=47 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=47 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=47 remoteAddress=2a00:79e1:2e00:3f01::/64}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=47 remoteAddress=fe80::/64}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=47 remoteAddress=ff00::/8}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=51 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=51 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=51 remoteAddress=ff00::/8}: false

On cuttlefish (15 is buried_eth0, 17 is wlan0):
  sLocalNetAccessMap (default is true meaning global):
    LocalNetAccessKey{lpmBitlen=144 ifIndex=15 remoteAddress=192.168.0.0/16}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=15 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=15 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=15 remoteAddress=ff00::/8}: false
    LocalNetAccessKey{lpmBitlen=192 ifIndex=17 remoteAddress=192.168.99.1 protocol=6 remotePort=53}: true
    LocalNetAccessKey{lpmBitlen=192 ifIndex=17 remoteAddress=192.168.99.1 protocol=17 remotePort=53}: true
    LocalNetAccessKey{lpmBitlen=144 ifIndex=17 remoteAddress=192.168.0.0/16}: false
    LocalNetAccessKey{lpmBitlen=132 ifIndex=17 remoteAddress=224.0.0.0/4}: false
    LocalNetAccessKey{lpmBitlen=160 ifIndex=17 remoteAddress=255.255.255.255}: false
    LocalNetAccessKey{lpmBitlen=96 ifIndex=17 remoteAddress=fe80::/64}: false
    LocalNetAccessKey{lpmBitlen=40 ifIndex=17 remoteAddress=ff00::/8}: false

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifcebc18c3804bc1d5d705752021bb4643ed58eb5

Maciej Żenczykowski   commited 2025-03-19 20:34:48 -07:00
969d82bc82
Revert "Make iterating over mNetworkAgentInfos safer."
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: I0c0b2724666cf6dfddbe3633fd50454f003ed133

Satish Yalla   commited 2025-03-19 20:18:37 -07:00
09bc78fda7
Revert "Always disconnect agents immediately."
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: I44affb742ca066406e93fc75056b4d3d1298eadb

Satish Yalla   commited 2025-03-19 20:18:37 -07:00
19dcc447c4
Revert "Immediately create networks unless chickened out"
Revert submission 3548747

Reason for revert: Droidmonitor created revert due to b/404956859. Will be verified through ABTD for standard investigation.

Reverted changes: /q/submissionid:3548747

Change-Id: Ic4226f2f1a20965f80b554967568a4450e460da2

Satish Yalla   authored and   Gerrit Code Review   commited 2025-03-19 20:18:37 -07:00
0141d82c2d
Release ClientNetworkRequest before marking request unfulfillable
Otherwise, the tear down code that unregisters the NetworkAgent runs
after calling declareNetworkRequestUnfulfillable() which surpresses the
onLost() callback.

Test: CSL2capProviderTest
Change-Id: I447881bd4bd76ba492abf6cc3177143db626749e

Patrick Rohr   commited 2025-03-19 17:12:07 -07:00
512b789a8d
Limit default capabilities to Android B+
It's possible that OEMs or device manufacturers may have relied on the
previous behavior (where interfaces without specified capabilities would
have minimal capabilities) to prevent certain Ethernet interfaces from
becoming the default network. To avoid breaking existing device
configuration, creating default network capabilities is limited by the
SDK level.

Bug: 399549599
Flag: EXEMPT bugfix
Test: atest ConnectivityCoverageTests
Change-Id: I46dc9fb02347710b09c0d2e8125b84a95f99fc9b

Chris Desir   commited 2025-03-19 16:58:21 -07:00
2f76304257
Merge changes I65763a52,Ib1d77da3,I5d8b3850 into main
* changes:
  Immediately create networks unless chickened out
  Always disconnect agents immediately.
  Make iterating over mNetworkAgentInfos safer.

Jean Chalard   authored and   Gerrit Code Review   commited 2025-03-19 15:09:28 -07:00
451f2dd39d
Merge "Skip enabling BTF on kernel older than 4.18" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 11:09:13 -07:00
1a0473bd72
Merge "Don't crash the system server when a misconfigured agent adds a DSCP policy" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2025-03-19 11:04:57 -07:00
51ac9ff7c4
Don't crash the system server when a misconfigured agent adds a DSCP policy
Additionally, when calling isEthernet(null), throw NPE instead of
SIGSEGV.

Test: New test in this patch
Change-Id: Ie80b860d4befe65a1777d0ebeb18d1807c6375d0

Chalard Jean   authored and   Patrick Rohr   commited 2025-03-19 08:24:45 -07:00
fd3ab6b212
Skip multi-device tests instead of abort if device is non-B+ devices
Test: TH
Change-Id: Ib27dea9197d5230313944777abb958f68425b213

Jimi Chen   commited 2025-03-19 14:38:06 +00:00
372a15220a
Add apf_ram_at_least decorator to restrict multi-device tests to the given minimum apf ram size capable device.
Test: TH
Change-Id: I1042fd0662695e9bc71833eb24311f4436b2676c

Jimi Chen   commited 2025-03-19 14:35:15 +00:00
8f712c6ed9
Merge "[Thread] add country code overlay to enable/disable setting Thread country code" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2025-03-19 07:27:48 -07:00
adb71602c5
Merge "Add DO app bypass for start/stopTethering" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-19 06:51:22 -07:00
038fd312fe
Add get exclude all host IPv6 multicast addresses function to apf_utils
Test: atest NetworkStaticLibHostPythonTests
Change-Id: Ib05eaf6ac94e9511a43b4b494eb5935746f50aa7

Jimi Chen   commited 2025-03-19 13:41:41 +00:00
ceefdceafd
[Thread] update the RRO config for OEM Android Border Router guide
Change-Id: I6a0dae4763c7bcf77695f02846e11a90abec51e4

Kangping Dong   commited 2025-03-19 05:13:36 -07:00
d03e594e0f
Immediately create networks unless chickened out
Test: ConnectivityCoverageTests CtsNetTestCases
Change-Id: I65763a528fb2cc04700ac8468eeca762b9eb01b5

Chalard Jean   commited 2025-03-19 21:03:23 +09:00
a13e335983
Always disconnect agents immediately.
This relands aosp/2623893 now that the underlying timing
issues have been fixed. It also addresses the two outstanding
comments that had not been fixed. It conditions it on the
"queue in system server" feature.

Currently, various codepaths in ConnectivityService disconnect
networks using NetworkAgentInfo#disconnect. This posts a message
to the NetworkAgent to disconnect and also posts a message to
ConnectivityService to call disconnectAndDestroyNetwork, which
performs all cleanup in ConnectivityService. These two messages
race and the order is non-deterministic.

Instead, always disconnect using disconnectAndDestroyNetwork,
and have disconnectAndDestroyNetwork post the message to the
agent to disconnect.

This fixes a bug where if wifi uses unregisterAfterReplacement
twice in quick succession, when the third agent connects it
doesn't work because the interface is still being used by the
second network.

Bug: 286649301
Test: covered by existing tests
Change-Id: Ib1d77da39232c02060a7a7c016ffd3a969e2356d

Lorenzo Colitti   authored and   Chalard Jean   commited 2025-03-19 21:03:23 +09:00
0e9f5e626b
Make iterating over mNetworkAgentInfos safer.
This CL provides convenience methods to iterate over all
networks.
- forEachNetworkAgentInfo takes a consumer and runs it on all
  networks in mNetworkAgentInfos. The consumer is allowed to
  remove any number of networks. This is needed because some
  loops over mNetworkAgentInfos result in disconnecting networks,
  which removes them from the set.
- anyNetworkAgentInfo takes a predicate and returns true iff it
  returns true on any element in mNetworkAgentInfos. The
  predicate is not allowed to modify the set in any way.

Bug: 288149251
Test: simple refactor, covered by existing unit tests
Change-Id: I5d8b38503895d33abc2d96daaa1c96372befce64

Chalard Jean   commited 2025-03-19 21:03:22 +09:00
ede14bde88
Merge "BpfNetMaps: auto populate interface tracker" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-19 04:44:30 -07:00
b9314970da
Merge "Skip hostside tethering test if not SdkLevel.isAtLeastB()" into main
Quang Luong   authored and   Gerrit Code Review   commited 2025-03-19 04:24:46 -07:00
b0cad64f5f
Skip enabling BTF on kernel older than 4.18
BPF_BTF_LOAD command was introduced in 4.18

Bug: 403381101
Test: boot on 4.9 kernel
Change-Id: Ibf2070750334417bd1052486c1f59a5d3f7fc20c

Motomu Utsumi   commited 2025-03-19 19:49:08 +09:00
6f1ceccf14