Commit graph

111,055 commits

Message SHA1
Remove SSLCertificateSocketFactoryTest @hide usage
Include verifyHostname in the test instead of calling the hidden API.

This removes a bit of coverage as verifyHostname itself is not tested
anymore, but it still verifies behavior of the verification and state of
the SSL session on socket creation.

verifyHostname is @hide API so it should not be exercised directly by
CTS.

Bug: 410435307
Flag: TEST_ONLY
Test: atest

Change-Id: I11f56e21ba242b7fcc5b84f6de992dc94d90ddee

Remi NGUYEN VAN   authored and   Junyu Lai   commited 2025-05-07 17:21:26 +08:00
145dc19675
Merge "Use the corresponding PackageManager for different users" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-05 21:58:40 -07:00
8c31a84f9f
Use the corresponding PackageManager for different users
Currently, isSatelliteDataOptimizedApp utilizes the PackageManager
from the primary user's context. However, if the added package is
not visible to the primary user, the satellite controller will
fail to parse the required information from the AndroidManifest.

Therefore, the corresponding PackageManager should be used when
a package is being checked.

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
      --update-device
Test: Manual:
      1. Create and setup 2nd user.
      2. adb install --user 10 CtsHostsideSatelliteDataOptimizedWithMetaData.apk
      3. adb shell dumpsys connectivity
      4. adb uninstall com.android.cts.net.hostside.satellitedataoptin.testapp
Bug: 410731080

Change-Id: I7adadb3449ec2ff984e6672ffb97919a2418e9b7

Junyu Lai   commited 2025-05-06 10:59:50 +08:00
988d00e57b
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
Add end-to-end test for DHCPv6-PD
This adds the basic structure for a full end-to-end test for DHCPv6-PD
using a tap interface. This tests the interaction between the DHCPv6-PD
client, IpClient, and Netlink callbacks, and the kernel.

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

Patrick Rohr   commited 2025-05-05 11:10:06 -07:00
7f6b868224
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
Merge "Automated log_list.json generation version 53.32" into main
Sandro Montanari   authored and   Android (Google) Code Review   commited 2025-05-05 04:15:49 -07:00
34de50dbcc
Format MdnsInterfaceAdvertiserTest with ktlint
Test: TH
Flag: EXEMPT test only change
Change-Id: I1f278dfebb17836ff0a928c08b68a7266ac4d90a

Yuyang Huang   commited 2025-05-04 14:39:36 +09:00
21a4193c7b
Automated log_list.json generation version 53.32
Bug: N/A
Test: N/A
Flag: NONE automatic key rotation
PiperOrigin-RevId: 754379882
Change-Id: Ibbf0d85b70e9f949a37fffe4239ba6a0d93c984f

Android Network Security   authored and   Copybara-Service   commited 2025-05-03 10:14:23 -07:00
d69ad204c8
Merge "Remove spurious VisibleForTesting annotation" into main
Maciej Ĺ»enczykowski   authored and   Android (Google) Code Review   commited 2025-05-02 14:22:14 -07:00
cfa9a2e9b6
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
Merge "Make NsdManager.registerService() public API" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-05-02 01:56:31 -07:00
41a3407e1f
Make NsdManager.registerService() public API
This commit makes the NsdManager.registerService() API public. This
change will enable developers to implement more customizable mDNS
advertising behavior in their applications.

Bug: 373270045
Test: atest CtsNetTestCases:NsdManagerTest
Flag: com.android.net.flags.mdns_advertising_improvement
API-Coverage-Bug: 415202964
Change-Id: I32359f7265b3597defd57123ecff0deaef0011f8

Yuyang Huang   commited 2025-05-02 15:23:14 +09:00
9e74d41f3d
Merge "Read meta-data instead of property" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-01 22:47:52 -07:00
3305741269
Read meta-data instead of property
Currently, the SatelliteAccessController checks if apps are
opt-in via a property tag under the application. This is
incorrect because PROPERTY_SATELLITE_DATA_OPTIMIZED is an
existing, released meta-data usage for Android B and needs
to be preserved.

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
  --update-device
Bug: 410731080
Change-Id: If09890faf5d208d007179ecc29b7cf16f6fe6ebb

Junyu Lai   commited 2025-05-02 12:08:38 +08:00
0beea1e992
Merge "Enforce run on handler thread for SatelliteAccessController" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-01 20:30:51 -07:00
be4ecf0ac4
Enforce run on handler thread for SatelliteAccessController
This is a no-op refactoring that ensures events are handled
on the handler thread. While this is already the case in
production code, it's not consistently true in the tests.

This change adds the necessary methods for faking events
on the handler thread while maintaining readability in the
tests.

Flag: EXEMPT refactor
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
      --update-device
Bug: 410731080
Change-Id: I816233a823314c4c276138438bbaf33f781eccfe

Junyu Lai   commited 2025-05-02 09:50:40 +08:00
00625abeda
Merge changes from topic "dhcp6-move" into main
* changes:
  Expose a getter for mStatusCode
  Add Dhcp6*Packet classes to net-utils-networkstack
  Move Dhcp6*Packet.java to staticlibs

Patrick Rohr   authored and   Android (Google) Code Review   commited 2025-05-01 14:20:06 -07:00
ff278aa0d7
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 "NetBpfLoad: relax version checks" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-05-01 09:35:40 -07:00
6305ca96e1
Merge "Add NET_CAPABILITY_NOT_RESTRICTED to test network in CtsNetUtils" into main
Jacque Li   authored and   Android (Google) Code Review   commited 2025-05-01 08:39:26 -07:00
d36772174f
NetBpfLoad: relax version checks
Test: TreeHugger
Flag: EXEMPT mainline
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie4ac3608d3f9599ffca40b0b2073f21efed7b17c

Maciej Ĺ»enczykowski   commited 2025-05-01 06:12:57 -07:00
cb55572675
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
Merge "Change tethering terrible error wtf log to info log" into main
Quang Luong   authored and   Android (Google) Code Review   commited 2025-04-30 16:25:51 -07:00
6a7aa5d28f
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
Merge "Adding IpAddress Struct type to store ip v4 and v6 addresses." into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-30 09:54:03 -07:00
652c41f3c2
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
Merge changes Ic80aff75,Ifc6aa8d6 into main
* changes:
  Support SharedLog for SatelliteAccessController
  Deduplicate fallback UID callbacks

Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-30 04:03:51 -07:00
c80e39d2ed
Merge "Add connectivity pre-check for CtsHostsideNetworkTests" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-30 02:45:52 -07:00
407cd52ca1
Support SharedLog for SatelliteAccessController
This is needed because user/package changed events occur rarely
and might not be included in bugreports when satellite network
problems occur.

This change also prints the feature flag in the dumpsys and
removing some logs which are redundant and not useful.

Sample output:
SatelliteAccessController:
  SupportConstrainedDataSatelliteOptIn: true
  Role-Sms Uids: {0={10138}}
  Opt-In Uids: {}
  Log:
  2025-04-29T15:22:50.816963 - SmsRoleUids: {10138} Opt-InUids:{}
  2025-04-29T15:22:49.164469 - SmsRoleUids: {10138} Opt-InUids:{10260}
  2025-04-29T15:22:24.392085 - SmsRoleUids: {10138} Opt-InUids:{}

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
--update-device
Bug: 410731080

Change-Id: Ic80aff756a0552e7d0e26fb906460c31e67a960e

Junyu Lai   commited 2025-04-30 16:27:21 +08:00
a79574a9e5
Add connectivity pre-check for CtsHostsideNetworkTests
Test: atest CtsHostsideNetworkTests
Flag: TEST_ONLY
Change-Id: If7f8cd614f0528248ca87be1d3aac5396b64e071

Paul Hu   commited 2025-04-30 01:14:24 -07:00
882a44f978
Deduplicate fallback UID callbacks
Currently, onUserAdded calls onRoleSmsChanged, which triggers a
fallback UIDs callback.  Updating opt-in UIDs also triggers a
callback. The callback triggered by onRoleSmsChanged actually
not necessary and should be removed.

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
      --update-device
Bug: 410731080

Change-Id: Ifc6aa8d6b798cca2bfc575f986a012c52ea75667

Junyu Lai   commited 2025-04-30 16:12:06 +08:00
f0e3d9b1d7
Merge "Add @UnsupportedAppUsage to NsdManager.registerService for MediaShell" into main
Yuyang Huang   authored and   Android (Google) Code Review   commited 2025-04-29 23:36:44 -07:00
649064703e
Add @UnsupportedAppUsage to NsdManager.registerService for MediaShell
The NsdManager.registerService() method was originally scheduled to
become a public API in the 25Q2 release. However, this transition did
not occur as planned. The current target for making this method a public
API is the 25Q4 release. In the interim, the @UnsupportedAppUsage
annotation is being added. This is necessary to support an internal
MediaShell use case for the 25Q2 TV release. This change marks the API
as available in the dex so callers can call without being blocked by
hidden API restrictions. This API will be marked as public API
immediately after this change for 25Q4.

Test: TH
Flag: EXEMPT no logic change
Change-Id: I8e6e33ca224f459c3d8344c05ea6d6e5a4556a8d

Yuyang Huang   commited 2025-04-30 15:33:43 +09:00
d3bae6f3cc
Improve naming for SatelliteAccessController
This is a no-op refactoring, which renames several methods and
variables to more accurately reflect their functionality and
follow the naming style.

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
--update-device
Bug: 410731080

Change-Id: I84b9eca60f2b8543b8bdb7cf972103b79105e670

Junyu Lai   commited 2025-04-30 11:58:49 +08:00
b0b5dcf96e
Change tethering terrible error wtf log to info log
Terrible errors in Tethering.java aren't used to log actual errors, but
just to provide metrics on how often these expected codepaths occur. To
avoid spamming the android error logs or crashing eng devices, change
these to use info logs instead.

Flag: EXEMPT logging change only

Bug: 410470516
Test: atest TetheringTest
Change-Id: I4ec202231e79c32f727a7620a6cab08e850d1629

Quang Anh Luong   commited 2025-04-30 12:16:30 +09:00
5408415ab1
Add NET_CAPABILITY_NOT_RESTRICTED to test network in CtsNetUtils
Bug: 404377608
Flag: TEST_ONLY
Test: atest CtsNetTestCases
Change-Id: I594de55622d20d6fe178d121472d95b92c611ee4

Jacque Li   commited 2025-04-29 20:14:27 -04:00
d161f1dcf1
Merge "Migrate CT demo app to Android" into main
Sandro Montanari   authored and   Android (Google) Code Review   commited 2025-04-29 05:07:55 -07:00
a7a37a8497
Migrate CT demo app to Android
Bug: 409238442
Test: m CertificateTransparencyDemoApp
Flag: NONE demo app for testing
Change-Id: I499989131a9ae8a37425caa420f6b9d4c415f7d0

Sandro Montanari   commited 2025-04-29 04:07:46 -07:00
e9524a5298
Merge "Listen to onExternalApplicationsAvailable in SatelliteAccessController" into main
Treehugger Robot   authored and   Android (Google) Code Review   commited 2025-04-28 06:37:49 -07:00
bc08a1ffcb
Listen to onExternalApplicationsAvailable in SatelliteAccessController
For maintaining constrained data satellite opt-in apps, this is
needed for tracking apps installed on the storage.

Flag: EXEMPT flagged with a kill switch
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.connectivity.SatelliteAccessControllerTest \
  --update-device
Bug: 410731080
Change-Id: I2a686a5a37747de97dcee6b78f66965cb4fd9942

Junyu Lai   commited 2025-04-28 16:35:36 +08:00
63dbd3ec93
Merge changes Iabc2fad0,I2078330b into main
* changes:
  Improve TestableNetworkOfferCallback
  Add a way to poll with a position for ReadHead

Jean Chalard   authored and   Android (Google) Code Review   commited 2025-04-27 23:25:04 -07:00
74dcb4637c