Commit graph android_packages_modules_Co.../staticlibs
Message SHA1
Merge "Cleanup and improve logging for DefaultNetworkRestoreMonitor" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-09 02:24:31 -07:00
bb2c4e66ef
Cleanup and improve logging for DefaultNetworkRestoreMonitor
Bug: 413188127
Flag: EXEMPT test-only
Test: CtsNetTestCases
Change-Id: I16938de33e1beee1a38c76eeae2fcf52d8f79870

Chalard Jean   commited 2025-05-09 16:43:56 +09:00
e73d3b934c
Clean up an old flag for removed downstream branches
Test: TH
Flag: EXEMPT test-only
Change-Id: I4a860c7c42afdfb5249b787daee80395096f5c84

Chalard Jean   commited 2025-05-09 14:59:29 +09:00
893f84f96e
Merge "Require DnsResolver M-2025-07 for DDR" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-08 17:40:37 -07:00
72f502bbe9
Merge "Fix for timing issue for handling user interaction addExternalApprover" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-05-07 02:48:27 -07:00
8014cfea1e
Fix for timing issue for handling user interaction addExternalApprover
If client knows network name and passphrase, it can connect to the
server (Group owner) without user interaction. In this case, it needs
to use interface address of group owner, not device address

Bug: 408245757
Test: atest CtsConnectivityMultiDevicesTestCases
Flag: EXEMPT bug fix
Change-Id: I47bc8609e63564f4226a4ef71ea9e382f5f919fe
Signed-off-by: Rohit Kothari <r.kothari@samsung.corp-partner.google.com>

Rohit Kothari   authored and   Paul Hu   commited 2025-05-07 02:47:38 -07:00
50b479097d
Network name for Wi-Fi Direct group should have prefix DIRECT-xy.
Network name for Wi-Fi Direct group must starts with the prefix DIRECT-xy.
But CTS sometimes makes name with non-character in the position of “xy”.
To prevent issue, network name needs to be generated with the prefix DIRECT-xy.

Bug: 408245757
Test: atest CtsConnectivityMultiDevicesTestCases
Flag: EXEMPT bug fix
Change-Id: Ida07616b920b32dadd76f732ff2d87cc6ecc960d
Signed-off-by: Rohit Kothari <r.kothari@samsung.corp-partner.google.com>

Rohit Kothari   authored and   Paul Hu   commited 2025-05-07 00:34:24 -07:00
756adee79c
s/IaId/Iaid/ for consistency
rfc8415 calls it IAID, not IA_ID.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I449ef74e279a832f974d1780e10f3636e7bdaf34

Patrick Rohr   commited 2025-05-05 12:42:51 -07:00
297945d661
Add packet builder support for rapid commit option
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I4fde592fca440d08f5d07f090d3c9ad45c2c10a1

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
bde43b8a72
Add IA_PD Option support to packet builder
The IA_PD Option is modeled as a separate "packet", because it can
contain various options itself. It turns out that with the current
packet builder architecture, building nested packets (of which DHCPv6 is
an extreme example) is actually quite difficult. We would encounter
similar problems if we ever were to try and build netlink packets.

One thing that could be done is to add another overload for
PacketBuilder#div that takes another PacketBuilder object, allowing an
syntax such as:

dhcp6_header / dhcp6_rt_sol_max / (dhcp6_ia_pd / dhcp6_ia_prefix)

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I35694627285759dd17d8a8bf5994aaa96e6b391d

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
424655f497
Add payload support for Dhcp6Pkt
IA_PD options will be modeled as separate packets

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I2841b1d2283fa50bdc664ab865e64f92aba3ce0c

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
ea3f8b0fb1
Add packet builder support for commonly used DCHPv6 options
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I38f3250279c85177fc4ce8f44a35ae3883e7a8ae

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
684c48afb0
Add Dhcp6Pkt PacketBuilder support
This adds support for building the Dhcp6Pkt header. Options are added
later.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I588d8fc6ba68d1132a3beb1b436d8175ac0ae577

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
3b88b3cec5
Make NdResponder thread-safe
Note that a new neighbor can still be added while processing a packet,
which may influence the result, though this shouldn't affect tests.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: If6860f3a52a406bbbbdd323061bfb918f1fb866c

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
86b2aed4f4
Remove spurious VisibleForTesting annotation
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I5104b4875159bb9df6a380c846ec01be67a82d2c

Patrick Rohr   commited 2025-05-02 09:07:03 -07:00
9796d817a8
Expose a getter for mStatusCode
So it is accessible by the test.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ibc30ede2e6a21e33ad3b4d7f21d03aba54a121ba

Patrick Rohr   commited 2025-05-01 11:16:41 -07:00
a2a1295adc
Add Dhcp6*Packet classes to net-utils-networkstack
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ica554c27a648095a23331a9d93cc6bbbcf572cec

Patrick Rohr   commited 2025-05-01 11:16:41 -07:00
f5e80bfb70
Move Dhcp6*Packet.java to staticlibs
For use in tests. This CL won't build by itself

mv NetworkStack/src/android/net/dhcp6/Dhcp6*Packet.java \
Connectivity/staticlibs/device/com/android/net/module/util/dhcp6

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: Ie072f2f20ecfbf23f77606dd064e0f6fbd7c2232

Patrick Rohr   commited 2025-05-01 11:16:41 -07:00
1ff7c3ef71
Merge "Update outdated example code" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-05-01 00:59:52 -07:00
ffd713da3d
Merge changes Id3eaa838,If07fb6c1 into main
* changes:
  Move failWithErrorReason to a common place
  Enable the last preference tests

Jean Chalard   authored and   Android (Google) Code Review   commited 2025-04-30 20:05:50 -07:00
175e8aeebf
Update outdated example code
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I0a87d71f693edcf13ad85049bff24169ddbedb3e

Patrick Rohr   commited 2025-04-30 12:24:09 -07:00
09c0307b9a
Adding IpAddress Struct type to store ip v4 and v6 addresses.
IPv4 addresses will be converted as v4-mapped-v6 address while
writting it to byte form. v4-mapped-v6 addresses in byte form will be
parsed to Inet4Address while converting it back.

Bug: 392509494
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.StructTest
Flag: EXEMPT refactor
Change-Id: Ia906d2cae7bb7402ff937da267c2552431b2d0f7

Sarup Dalwani   commited 2025-04-30 07:42:25 -07:00
746540b874
Require DnsResolver M-2025-07 for DDR
The DnsResolver needs to support FLAG_TRY_ALL_SERVERS, so this limits
the feature to devices having a new enough version of the resolver.

Test: atest
Bug: 240259333
Flag: EXEMPT legacy flag dns_ddr_version
Change-Id: I30fd55c9c2863857ca477b738ace88712ca01be3

Remi NGUYEN VAN   commited 2025-04-30 18:26:55 +09:00
6f04bb0ef4
Move failWithErrorReason to a common place
This is a shared public utility. Its main utility is for methods
that can fail, have an error message of their own, and also want
to take an error message from a caller and want to combine them.
Example use :
fun <T> assertEquals(expected: T, actual: T, msg: String? = null) {
  if (expected != null) {
    failWithErrorReason(msg, "Expected $expected, got $actual")
  }
}
...which allows someone to say
assertEquals(a, b, "Checking a vs b")

Test: TH
Flag: EXEMPT test-only change
Change-Id: Id3eaa8384b4177f38f13576d9b4d742c52027ae4

Chalard Jean   commited 2025-04-27 15:54:35 +09:00
c96d1ae0e6
Improve TestableNetworkOfferCallback
Update it to follow the latest conventions and add support for
eventuallyExpect.

Test: ConnectivityCoverageTest
Flag: EXEMPT test-only change
Change-Id: Iabc2fad051b874e3e18a0645361409f0427891fb

Chalard Jean   commited 2025-04-27 15:54:34 +09:00
5f3997b6af
Add a way to poll with a position for ReadHead
It was thought originally that it would not make a lot of sense to
offer such a call, but with usage it became clear that there is a
simple, obvious and useful behavior.
In particular this is very useful to mix eventuallyExpect and
expect calls. Interestingly, before this patch, calling
callback.eventuallyExpect<...>()
callback.expect<...>()
does not actually behave like you would intuitively think, because
eventuallyExpect does not advance the read head. When this
utility was made we thought this was the better behavior, but
usage has shown that advancing is both obvious and more useful.

Astonishingly, there seem to be no caller who needs to
eventuallyExpect() and later expect(), meaning that this
behavior change is apparently fine.

Test: ConnectivityCoverageTest and treehugger
Flag: EXEMPT test-only change
Change-Id: I2078330bd913cf0f75240bf3d4852e487e3e0163

Chalard Jean   commited 2025-04-27 15:54:33 +09:00
a14fb7cf79
Merge "File the per-app request for opted-in satellite-optimized apps" into main
Jean Chalard   authored and   Android (Google) Code Review   commited 2025-04-26 18:18:21 -07:00
31dce78e09
File the per-app request for opted-in satellite-optimized apps
Test: ConnectivityCoverageTest
Bug: 410731080
Flag: EXEMPT controlled in counter-part change ag/33220291
Change-Id: I0307f697a441c2810cafd4643d381e66a0ac9243

Chalard Jean   commited 2025-04-27 02:12:44 +09:00
76a60c1654
Merge "Refactor CarrierConfigRule carrier privilege" into main
Quang Luong   authored and   Android (Google) Code Review   commited 2025-04-24 23:33:19 -07:00
81a8ec0bcf
Refactor CarrierConfigRule carrier privilege
Addressing leftover comments in ag/33040619 regarding carrier privilege
acquisition in CarrierConfigRule with the following changes:
1) Refactored CarrierPrivilegeCallback to match records using a lambda.
2) Added various helper methods to handle calls with permissions.
3) Moved wait for carrier privlege to overrideConfigAndWait.
4) Fixed acquireCarrierPrivilege to append to current cert strings
   instead of overwriting them.
5) Fixed dropCarrierPrivilege to remove from current cert strings
   instead of cleaning up all configs.

Flag: EXEMPT test only change

Bug: 409710349
Test: atest TetheringManagerTest
Change-Id: I1165d95775e809f1aa8905af029fb13df0d3a1a8

Quang Anh Luong   commited 2025-04-25 12:50:32 +09:00
b4f1e46e6d
Merge "Replace Message with related arguments in RealtimeScheduler" into main
Paul Hu   authored and   Android (Google) Code Review   commited 2025-04-24 19:06:40 -07:00
02af3afeee
Merge "Remove non-functional IGMPv3 test and flaky APF checks" into main
Maciej Żenczykowski   authored and   Android (Google) Code Review   commited 2025-04-22 03:38:25 -07:00
90ba9c5ee9
Remove non-functional IGMPv3 test and flaky APF checks
This commit removes the test_igmpv3_general_query_offload() test
logic. This test fails on user builds because they run on non-rootable
devices, preventing the necessary test operations.

Additionally, the APF counter check logic is removed as it was causing
test flakiness and instability.

Bug: 406570694
Test: TH
Flag: EXEMPT test only change
Change-Id: I9f2f32c49737721e537d578d6df41d4062d0684f

Yuyang Huang   commited 2025-04-22 18:02:55 +09:00
3781d05054
Replace Message with related arguments in RealtimeScheduler
This change ensures that the Message object is created and
obtained within RealtimeScheduler, preventing modification
by the caller.

Fix: 386274963
Test: atest ConnectivityCoverageTests NetworkStaticLibTests
Flag: EXEMPT bug fix
Change-Id: I4c919857bcaa2d49717859dca9c88a243cbb7a41

Paul Hu   commited 2025-04-22 01:45:13 -07:00
1dea0d630e
Merge "Move getTestableNetworks to a common location" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-21 00:36:58 -07:00
cb677726c6
Move getTestableNetworks to a common location
Use a common code path for getTestableNetworks, which obtains Wi-Fi and
cellular from network callbacks. This avoids mixing callbacks and
synchronous calls, as getTestableNetworks may be called after
ensureWifiConnected, which uses NetworkCallbacks.

Test: atest
Bug: 253698734
Flag: TEST_ONLY
Change-Id: I8bf946b5258270554286e52b8aa3189aa2ba52e1

Remi NGUYEN VAN   commited 2025-04-21 15:18:57 +09:00
46f86934e1
Merge "Remove @JvmSerializableLambda usage in CarrierConfigRule" into main
Quang Luong   authored and   Android (Google) Code Review   commited 2025-04-17 15:04:06 -07:00
f0a44a9a23
Remove @JvmSerializableLambda usage in CarrierConfigRule
@JvmSerializableLambda was used in NetworkAgentTest to get around the
link error caused by JUnit enumerating through lambda methods that
referenced classes that weren't available on older platform versions.

Since this code was ported from NetworkAgentTest to CarrierConfigRule
whose lambda methods are not enumerated by JUnit, this workaround isn't
necessary anymore.

Flag: EXEMPT test only change

Bug: 409710349
Test: atest TetheringManagerTest
Change-Id: Ib876e237b239661548ae3c1d23fcb52f389f6254

Quang Anh Luong   commited 2025-04-17 17:10:44 +09:00
5db5a47144
Merge "Build net-tests-utils-host-device-common with module_current" into main
Motomu Utsumi   authored and   Android (Google) Code Review   commited 2025-04-16 23:20:14 -07:00
897c69ddaf
Merge "Fix carrier privilege race condition" into main
Quang Luong   authored and   Android (Google) Code Review   commited 2025-04-16 15:19:02 -07:00
fae887a44b
Fix carrier privilege race condition
CarrierConfigRule cleanup does not wait for carrier privilege value
to change before continuing to the next test, which may cause test
failures if the value isn't fully reset on time.

Make sure the value has time to properly be reset by waiting for
onCarrierPrivilegesChanged before proceeding.

Flag: EXEMPT test only change.

Bug: 409710349
Test: atest TetheringManagerTest#testCarrierPrivilegedIsTetheringSupported TetheringManagerTest#testCarrierPrivilegedStopTetheringWifiWithConfigSucceeds

Change-Id: If67884514a2c1678834ab9ff67947e75e37db0a7

Quang Anh Luong   commited 2025-04-16 15:02:54 +09:00
9bd526d7d4
Build net-tests-utils-host-device-common with module_current
Allow module with "sdk_version: module_current" to depend on
net-tests-utils-host-device-common.
This CL also makes this module visible to cronet

Bug: 311792075
Test: TH
Flag: EXEMPT Android.bp sdk_version and visibility change
Change-Id: I3b1068e12d4abbd34006aae69bbd314fcf05d060

Motomu Utsumi   commited 2025-04-16 08:58:33 +09:00
788ce2fa37
Add SLLAO support to RaPkt
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I1c0050ca1b634dfa7b2ac5de551a2470e06a9791

Patrick Rohr   commited 2025-04-14 15:47:41 -07:00
ea0364b5d4
Use HexDump instead of Kotlin Experimental API
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I5d0e4989194eecc90e00b1903f8458d9df098ff4

Patrick Rohr   commited 2025-04-14 15:47:41 -07:00
db7d961fb3
Rename lifetime params for brevity
Line breaks make tests harder to read, so this change should help
fitting everything on a single line.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I286c4398a2f738ab82498b93f9f9344577befeb8

Patrick Rohr   commited 2025-04-14 15:47:41 -07:00
c43cc96360
Align UdpPkt with scapy
Renames srcPort to sport and dstPort to dport and generates a random
port number in the range of [1, 65536) if no argument is passed.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: If446cde9a7ff414f52c60f70458ff046a2c4dc33

Patrick Rohr   commited 2025-04-14 15:47:41 -07:00
ea520794cc
Expose backtrace() in PollPacketReader
Figuring out what packets were received is useful for debugging.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I3184845b76e33da186f39a2344548c2d16715173

Patrick Rohr   commited 2025-04-11 15:59:37 -07:00
f39b748cbf
Add support for setting hop limit
Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I7ee5b0f31b4db633451a0ddee5d92e45e5947f84

Patrick Rohr   commited 2025-04-11 15:11:33 -07:00
1586ffbeb1
Move ProcfsParsingUtils to staticlibs
net-utils-device-common says:

This library shouldn't be used anymore (no class should be added), and
per-user libraries like net-utils-service-connectivity or
net-utils-framework-wifi should be used instead.

Therefore, this patch adds a new net-utils-networkstack.

Test: TH
Flag: EXEMPT mainline
Bug: 1000001
Change-Id: I8073ea019a9c306ce75424303e8a30bb39580b29

Patrick Rohr   commited 2025-04-11 15:11:33 -07:00
259c0b4f66
Merge "Print module version in CtsNetTestCases conndiag" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-10 02:09:09 -07:00
e2209bf89b