Commit graph

107,305 commits

Message SHA1
Prefer framework-annotations-lib dependency
Rather than bundling a copy of the framework annotations, reference them
via framework-annotations-lib as a libs reference. This ensures the
target inherits any necessary keep rule configurations, and is the same
pattern used by other mainline modules.

Bug: 275175207
Test: m
Flag: EXEMPT refactor
Change-Id: I014aa79f4fec69aef062a2fb855a50f658380ac5

Jared Duke   commited 2024-09-27 18:41:54 +00:00
dff99282e8
Merge "[Thread] support discovering NAT64 prefix from AIL" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-09-23 03:58:57 +00:00
5f9a3d042e
[Thread] support discovering NAT64 prefix from AIL
Bug: 357479886

Change-Id: I8dfd96a0ba3e927ed4cbc8ceecb18652adf98964

Handa Wang   commited 2024-09-23 02:35:07 +00:00
b47c325907
Merge "Fix NullPointerException in Ikev2VpnTest for watches" into android15-tests-dev am: de32aa8b11
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3272967

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

Yeabkal Wubshit   authored and   Automerger Merge Worker   commited 2024-09-20 21:49:50 +00:00
6566f7c57d
Merge "Fix NullPointerException in Ikev2VpnTest for watches" into android15-tests-dev
Yeabkal Wubshit   authored and   Gerrit Code Review   commited 2024-09-20 21:40:34 +00:00
de32aa8b11
Fix NullPointerException in Ikev2VpnTest for watches
Watches do not have a VpnManager instance anymore, so the tests crashes
at the teardown step when trying to interact with a null VpnManager.

Bug: 368624224
Bug: 340928692
Test: Ikev2VpnTest
Change-Id: Iedf784625933e73bcb5fed9bfa36fbae1e11d398

Yeabkal Wubshit   commited 2024-09-20 19:51:41 +00:00
13c6573270
Merge "[Thread] refactor setInfraLinkState" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-20 09:51:58 +00:00
adc778d038
Merge "Add createSetLinkNameMessage method at RtNetlinkLinkMessage" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-20 08:12:42 +00:00
5fdce4d932
Merge "Allow ot-ctl command under ADB Thread Network Service : support of non-interactive mode" into main
Yang Song   authored and   Gerrit Code Review   commited 2024-09-20 07:32:01 +00:00
2d17714c24
[Thread] refactor setInfraLinkState
This CL integrates the refactoring of aosp/3264051.

Bug: 365892457
Change-Id: I77788c06db02abbf2275fda3015b0f3fa63920e0

Handa Wang   commited 2024-09-20 06:34:51 +00:00
e24b215bf2
Merge "Let NsdPublisher pass the interface index when a service is resolved." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-09-20 05:13:43 +00:00
631ded17fc
Allow ot-ctl command under ADB Thread Network Service : support of non-interactive mode
Bug: 351721329

Test: atest ThreadNetworkUnitTests

Change-Id: Id7443c24ea380d200e73cca4ead2284249f2052f

Yang Song   commited 2024-09-20 03:58:14 +00:00
ffceaae1b8
Let NsdPublisher pass the interface index when a service is resolved.
The mapping from network to interface name is passed from
ThreadNetworkControllerService to NsdPublisher, so that NsdPublisher can
send interface index to mdns subscribers when a service is resolved.

Bug: 321883491

Test: presubmit
Change-Id: I401c38ba3fbc7b2a2de5cbc9ab1132c657518f32

Yang Sun   commited 2024-09-20 11:09:54 +08:00
9bf8e48c2a
Merge "Add createSetLinkStateMessage method at RtNetlinkLinkMessage" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-20 01:48:30 +00:00
dde0dc63d3
Merge "Format the code in ThreadNetworkController.java" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-20 00:54:32 +00:00
007c62dfd3
Add createSetLinkNameMessage method at RtNetlinkLinkMessage
This CL mainly adds the createSetLinkNameMessage() method at the
RtNetlinkLinkMessage class, that creates a link message to rename the
network interface. The functionality is the same as
"ip link set $interface name NEW_NAME".

Bug: 364501824
Test: atest NetworkStaticLibTests
Change-Id: I6323bce1ece10f4437483214860d50cb7d29df8d

Chih-Yu Huang   commited 2024-09-20 09:15:52 +09:00
9f8ed83e04
Add createSetLinkStateMessage method at RtNetlinkLinkMessage
This CL mainly adds the createSetLinkStateMessage() method at the
RtNetlinkLinkMessage class, that creates a link message to set the
interface up or down. The functionality is the same as
"ip link set $interface up" or "ip link set $interface down".

Bug: 364501824
Test: atest NetworkStaticLibTests

Change-Id: Id9232851f6d9a7f99f857fd5b8d4eae506de2c7c

Chih-Yu Huang   commited 2024-09-20 09:06:19 +09:00
73f5b138a2
Merge "bpf: merge block.c into netd.c" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-19 12:14:44 +00:00
51452289e8
Format the code in ThreadNetworkController.java
Change-Id: I3471f53396afb12768aa279a1ab059ffbfd8671e

Yang Sun   commited 2024-09-19 10:15:51 +00:00
75a6bf3958
Merge changes from topics "ddr-tests-in-networkstack", "move-fakedns" into main
* changes:
  Move to one unified implementation of FakeDns.
  Add test utils for SVCB packet generation.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2024-09-19 06:19:31 +00:00
3627907075
Move to one unified implementation of FakeDns.
Take the functionality from the (better) FakeDns in NetworkStack,
move it to the FakeDns in staticlibs, and port it to kotlin.

Test: test-only change
Change-Id: I6d0b4a348ca86ab69785cdf722c259ef6a92ce4b

Lorenzo Colitti   commited 2024-09-19 12:51:28 +09:00
5355fce9b2
Fix typo in RCP documentation
Change-Id: I65d405caa240ad70ca9640f1914a0ce243cf7e9f

Kangping Dong   commited 2024-09-19 02:38:36 +00:00
da59f47a57
Fix typo in "build-an-android-border-router.md"
Change-Id: I3d6c7632b8c5395fc9213607bd771b1809cc6fd1

Kangping Dong   commited 2024-09-19 02:22:00 +00:00
f286919f80
Merge "NetBpfLoad: noop - all programs are critical" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-19 02:20:13 +00:00
51144accb2
[automerger skipped] Skip TestDropPacketToVpnAddress if the feature is disabled am: 41ce7c550c -s ours
am skip reason: Merged-In Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d with SHA-1 9d5d7d0779 is already in history

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

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

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2024-09-19 01:24:39 +00:00
9e9b46722c
bpf: merge block.c into netd.c
Since this is just a special case of a bpf cgroup hook,
it really should be in netd.o with all other such hooks.

Besides moving/renaming the map & programs this should be a no-op.

Test: TreeHugger, atest bpf_existence_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4a2aedaf77f89a9c0a96fa1c369d80659535eabe

Maciej Żenczykowski   commited 2024-09-19 00:40:53 +00:00
3ad3794efa
NetBpfLoad: noop - all programs are critical
All 6 .c files under bpf/progs are flagged CRITICAL(),
and as such we can simplify this logic.

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

Maciej Żenczykowski   commited 2024-09-18 23:46:16 +00:00
3a085154c5
Merge "Fix deadlock from outside Perfetto mutex" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-18 21:23:28 +00:00
a0eabde1f7
Merge "Merge ConsumeAllLocked into ConsumeAll" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-18 21:23:27 +00:00
a17967c1e5
Merge "Add separate mutex for BPF ring buffer." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-18 21:23:26 +00:00
312777655a
Fix deadlock from outside Perfetto mutex
Fixes the deadlock described by the below two thread states:

Thread 1:
- ConsumeAll() (takes mBufferMutex)
- perfetto::DataSource::Trace() (takes Perfetto mutex)

Thread 2:
- StartDataSourceImpl() (takes Perfetto mutex)
- NetworkTracePoller::Start() (takes mBufferMutex)

Locks should always be taken in the same order. To achieve this,
ConsumeAll only locks mBufferMutex while accessing the buffer, and
releases it before calling the callback (which under typical use calls
DataSource::Trace() as in "Thread 1").

As a fun side note, Start() always calls ConsumeAll(), so there exists a
lock sequence of perfetto mutex -> mBufferMutex -> perfetto mutex, thus
this order was always "exercised". However, Perfetto uses a recursive
mutex, so the second lock was a no-op, making this hard to catch.

Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: If8c5e0e218666ec53a287ec56333a6d3b8cfe08f

Ryan Zuklie   commited 2024-09-18 18:41:11 +00:00
e8a769f2c3
Merge ConsumeAllLocked into ConsumeAll
There no longer needs to be separate locked and unlocked methods now
that the buffer has its own mutex.

The most notable change is that within PollAndSchedule, we go from using
try_lock to using the scoped_lock in ConsumeAll. The try_lock was meant
to prevent the following deadlock:
- Stop() takes mMutex and calls mTaskRunner.reset()
- mTaskRunner awaits completion of final closure (PollAndSchedule)
- PollAndSchedule is blocked trying to acquire mMutex

Now that ConsumeAll depends only on mBufferMutex, a more elegant
solution is to just ensure that Stop() isn't holding mBufferMutex while
calling mTaskRunner.reset().

Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: Id5df18bc5809ba193bbe1aa0b97121bd5a8afdcd

Ryan Zuklie   commited 2024-09-18 18:37:00 +00:00
7e9f27be7d
Add separate mutex for BPF ring buffer.
This covers the ring buffer and ConsumeAll methods. This change also
removes unnecessary GUARDED_BY for TraceIfaces (making it static) and
mCallback (making it const).

This should be close to a no-op. The new lock is taken in addition to,
or instead of in the few places it's needed.

Bug: 320700806
Test: atest libnetworkstats_test
Change-Id: I45d36eba033afae1c03eac2f8d5b2ac4c9e78716

Ryan Zuklie   authored and   Maciej Żenczykowski   commited 2024-09-18 18:34:17 +00:00
52a8f3c275
Skip TestDropPacketToVpnAddress if the feature is disabled
INGRESS_TO_VPN_ADDRESS_FILTERING is disabled due to b/352424251 and
testDropPacketToVpnAddress fails if the feature is disabled.
So skip testDropPacketToVpnAddress if the feature is disabled.

Bug: 362434644
Test: adb shell device_config put tethering
      ingress_to_vpn_address_filtering -1
Test: atest CtsHostsideNetworkTests
(cherry picked from https://android-review.googlesource.com/q/commit:9d5d7d07793549a9c8a19d6277c498683cb7da3f)
Merged-In: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d
Change-Id: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d

Motomu Utsumi   authored and   Android Build Cherrypicker Worker   commited 2024-09-18 11:12:45 +00:00
41ce7c550c
Merge "Migrate CT namespace to "network_security"" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2024-09-18 09:07:58 +00:00
413e0276ff
Merge "Make RtNetlinkLinkMessage class immutable after creation" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-18 03:28:35 +00:00
e7f5ac9d2f
Make RtNetlinkLinkMessage class immutable after creation
This CL marks all the fields of RtNetlinkLinkMessage class final. That
means once the instance is created, the instance is immutable.

Also, the CL adds a static create method that verifies the arguments,
and updates the nlmsg_len field of the header before creation.

Bug: 364501824
Test: atest NetworkStaticLibTests

Change-Id: I08af4a6e68df9aee8ae76d953fac5d81f0b02c84

Chih-Yu Huang   commited 2024-09-18 10:46:07 +09:00
f4a0865055
[automerger skipped] Enable secondary_user_on_secondary_display for CtsNetApi23TestCases am: 893126b82a -s ours
am skip reason: Merged-In I9315eff338e5ba232c26e27d2885ab922abddabd with SHA-1 7969d8baff is already in history

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

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

bkchoi   authored and   Automerger Merge Worker   commited 2024-09-17 18:28:05 +00:00
d2a88a27b7
Enable secondary_user_on_secondary_display for CtsNetApi23TestCases
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on
devices that have config_multiuserVisibleBackgroundUsers enabled. The
main use case is Automotive's multi-display Whole Cabin experience where
passengers (modeled as visible background users) can interact with the
display in front of them concurrently with the driver (modeled as the
current user) interacting with driver's display.

Bug: 364635030

Test: atest CtsNetApi23TestCases
Test: atest --user-type secondary_user_on_secondary_display \
        CtsNetApi23TestCases

(cherry picked from https://android-review.googlesource.com/q/commit:7969d8baff85ae6c2165e7ac525c913546f070f0)
Merged-In: I9315eff338e5ba232c26e27d2885ab922abddabd
Change-Id: I9315eff338e5ba232c26e27d2885ab922abddabd

bkchoi   authored and   BK Choi   commited 2024-09-17 15:27:28 +00:00
893126b82a
Merge "Enable secondary_user_on_secondary_display for CtsNetApi23TestCases" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-17 07:55:02 +00:00
124d517391
Merge "Import translations. DO NOT MERGE ANYWHERE" into main
Bill Yi   authored and   Gerrit Code Review   commited 2024-09-16 19:11:07 +00:00
0eaf31af71
Migrate CT namespace to "network_security"
Instead of the current "tehtering" namespace.

Also, flags pushed via DeviceConfig come with a
"CertificateTransparencyLogList" feature prefix.

Flag: com.android.net.ct.flags.certificate_transparency_service
Bug: 319829948
Test: atest NetworkSecurityUnitTests
Change-Id: I565f888409f21e78cc28684cbf7daaae44b95d57

Sandro Montanari   commited 2024-09-16 12:12:14 +00:00
5319f5c363
Merge "BPF: rename bpf_defaults to bpf_cc_defaults" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-13 22:15:27 +00:00
9daf0afa3d
BPF: rename bpf_defaults to bpf_cc_defaults
With the addition of defaults to the bpf soong module (see aosp/3249485
), the name `bpf_defaults` will be used to define defaults for bpf
program compilation. While there are separate soong namespaces for
module types and module names, rename the existing bpf_defaults
cc_defaults to bpf_cc_defaults for clarity.

While we're at it, add -Wextra, and cleanup unnecessary cflags in
clauses which use bpf_cc_defaults. Add -Wno-sign-compare to resolve
build issues in external test code.

Test: TH
Change-Id: Id0407f86ad50033a77a8679d465dc9412991d764
Signed-off-by: Neill Kapron <nkapron@google.com>

Neill Kapron   commited 2024-09-13 18:41:24 +00:00
661ae85eb2
Merge "Remove cached services when the network is disconnected or unrequested" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-13 11:40:45 +00:00
6a7e703f17
Remove cached services when the network is disconnected or unrequested
The services in the cache are no longer useful after the network
is disconnected. Because either the Network object or the
interface index will change after the network is reconnected,
these cached services won't be used for any discovery/resolution/
service info callback requests. Therefore, these cached services
should be removed after the network is disconnected. Otherwise,
these useless cached services will occupy memory until the device
is rebooted.

In addition, the cached service may not be reliable after the
last listener is unregistered. Because the socket is
disconnected, the service type client won't receive any updates
for the services. Therefore, remove these cached services after
exceeding the keeping time.

Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I06ff320fec84f71dc2ed742c50fa46f25c284170

Paul Hu   commited 2024-09-13 06:13:37 +00:00
079c77c296
[automerger skipped] Enabled CtsThreadNetworkTestCases for secondary_user_on_secondary_display am: 395d5eba87 -s ours
am skip reason: Merged-In Iad7deb2c2715f6ef684ecc16b95a2fbbc7bb5260 with SHA-1 47b87650d1 is already in history

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

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

Mayank Garg   authored and   Automerger Merge Worker   commited 2024-09-12 20:18:04 +00:00
5cb76d073a
Enabled CtsThreadNetworkTestCases for secondary_user_on_secondary_display
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display Whole Cabin experience where
passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with driver's display.

Tested on gcar_md emu

Flag: TEST_ONLY

Bug: 356700021
Bug: 354233217
Bug: 358707308
Test: atest --user-type secondary_user_on_secondary_display CtsThreadNetworkTestCases
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b642178a9426f854f4496c07c8440d5ed417167c)
Merged-In: Iad7deb2c2715f6ef684ecc16b95a2fbbc7bb5260
Change-Id: Iad7deb2c2715f6ef684ecc16b95a2fbbc7bb5260
(cherry picked from commit 47b87650d1)

Mayank Garg   commited 2024-09-12 18:32:07 +00:00
395d5eba87
Merge "Remove assert for R+" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-12 17:20:11 +00:00
9f71aa3e4d
Merge "Remove Q support" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-12 16:46:12 +00:00
2842b3282d