For non-telephony, non-wifi networks, both extraInfo and SSID are likely
to be null, in which case
getString(network_available_sign_in_detailed, null) would be used for
the notification contents, which would just print "null" (by default the
string template is just "%1$s").
Use an empty string instead, as there is no string identifier for the
network. This should still be better than having text that says "null".
Test: atest
Bug: 334926818
Change-Id: I19bdba186d2402b40549b1ad5f97864b7c38ca10
Background chain transition delays are changing in the framework to be
longer for LAST_ACTIVITY and higher-priority and shorter for
lower-priority process-states. Updating tests to use the shorter timeout
wherever possible and using the longer timeout wherever the test
specifically tests for process-state LAST_ACTIVITY.
Flag: com.android.server.net.use_different_delays_for_background_chain
Test: atest CtsHostsideNetworkPolicyTests
Bug: 323963467
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:adf00ec210dc72b0075755065f5dfafa7971e70f)
Merged-In: I4ab0cef2e81c465753a8aa2228d2e0ddf1abf1ea
Change-Id: I4ab0cef2e81c465753a8aa2228d2e0ddf1abf1ea
Suprabh Shuklaauthored and Android Build Cherrypicker Workercommited 2024-06-12 17:35:14 +00:00
Extended the timeout of ApfIntegrationTest#testReadWriteProgram() to 15
minutes to accommodate devices with larger APF memory (e.g., 4K RAM).
Example run on a device with 4K APF RAM:
[1/1] android.net.cts.ApfIntegrationTest#testReadWriteProgram: PASSED (09m47.451s)
Bug: 346707554
Test: TH
Change-Id: I063abe285e061edf3a0d338ba7233a08be03c9b4
Instead of having an assert in the BroadcastReceiver, which runs in a
separate thread which crashes the test process on assertion failure,
move it to the test thread.
Bug: 345804242
Test: atest
Change-Id: Ib10cb1464918bcb978bdd9fae378427cb393f2f3
This change:
1. Move precondition checks prior to setup hotspot.
This removes the need of redundant clean-up if
the device doesn't meet preconditions.
2. Use unregisterAll instead of unregisterCell to
clean-up registered connections to prevent from
complex error handling in clean-up stage.
Test: m connectivity_multi_devices_snippet && \
atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 345110845
Change-Id: I4de0e7401d52f891948eb7b5a8c112a837cb0c3e
Enclosed each ParcelFileDescriptor.close() call in its own try/catch
block to ensure that if one closure throws an exception, the others will
still be attempted.
Bug: 346469095
Test: TH
Change-Id: Ib59fffaa39488acb73bbdbe8ebc795043f2b301f
Some tests were disabled by aosp/2676836 since these tests were flaky
(b/291701394).
b/291701394 was fixed. So, this CL re-enables them on presubmit.
Bug: 291701394
Bug: 342557183
Test: VpnTest --iterations 10
Change-Id: I299dd0dfd7d6cbdea2ad97477b5613c78af421e1
testDefaultCapabilitieswas was added when aosp/2539630 introduced
DEFAULT_FORBIDDEN_CAPABILITIES to avoid existing users getting callbacks
from local networks.
But aosp/2539630 was reverted and aosp/2936050 fixed this issue by
introducing compat flag.
testDefaultCapabilities was missed to be cleaned up due to the
annotation.
This CL updates testDefaultCapabilities to verify the default
capabilities and default forbidden capabilities are not changed on U-.
Test: NetworkRequestTest
Bug: 332466530
Change-Id: I62c990d0f2c73d159e7c93827bbec14d4d0c0f45
On V+, there could be satellite network which is not restricted but
bandwidth constrained.
These satellite network has NET_CAPABILITY_NOT_RESTRICTED but does not
have NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED.
Since NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED is set by default, this
CL remove this capability from per-app default network request for the
default messaging app.
Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I413bdb764ead42d67ce1315c365500dbb8508eb3
This change specifies the sdk_version property to the cts test modules
so that the test modules do not depend on the framework, and utilize the
test api instead.
Test: TH
Bug: 345499522
Change-Id: I876fb8681dadad9d123bedb38d67c1a31b0f3a54
* changes:
Use /proc/self instead of calling Os.getPid().
Use SingleWriterBpfMap in BpfNetMaps.
Add a microbenchmark test for BpfMap.
Add a SingleWriterBpfMap class that caches reads.
Deflake BpfMapTest#testNoFdLeaks.
Treehugger Robotauthored and Gerrit Code Reviewcommited 2024-06-06 08:30:20 +00:00
On V+, this capability is set by default.
Constrained satellite networks never become the system default network.
Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I020ba48e74f1f180e1807cbe1c066209bedb0454
This is to avoid running tests on devices that do not support Thread. Otherwise, the tests will fail with ClassNotFoundException when the test classes are loaded
Change-Id: I286394ae925ad7258aa82cd308ac963ee334992c
I believe this did not work in the first place. CompletableFuture#get()
might throw a timeout exception if TIMEOUT_MS is reached which fails the
assertion (but it should not!).
Anyway, it is unused, so just delete this method.
Test: TH
Change-Id: I43a747179eeaded320df32f40f1237be11de7867
Add a DeviceConfig flag that will be used to control whether callbacks
should be sent selectively based on whether the receiving method has
been overridden (will be implemented in a future change).
This adds utilities to allow ConnectivityManager to check whether a
ConnectivityService flag is enabled, as that feature will work across
ConnectivityManager and ConnectivityService. ConnectivityManager runs in
app process and does not necessarily have permissions to use
DeviceConfig. Also if it checked DeviceConfig separately from
ConnectivityService, values may be out-of-sync.
Test: atest, and see change using this
Change-Id: I204fa719cc627e84edc5c1e043d947f5ef3f8dee
Most of the maps used by BpfNetMaps are configuration maps that
in production code are only written to by BpfNetMaps. Move these
maps to SingleWriterBpfMap to take advantage of caching.
Specifically, the following are only written by BpfNetMaps in
production code:
- sConfigurationMap
- sUidOwnerMap
- sUidPermissionMap
- sDataSaverEnabledMap
- sIngressDiscardMap
Additionally:
- firewall.cpp writes to sConfigurationMap, sUidOwnerMap, and
sDataSaverEnabledMap, but that code only runs in tests because
it requires root privileges.
- NetworkStackBpfNetMaps also uses sConfigurationMap,
sUidOwnerMap and sDataSaverEnabledMap, but it opens all of them
with BPF_F_RDONLY so cannot write to them.
sCookieTagMap is left uncached because it's also written to by
netd (as part of socket tagging) and ClatCoordinator.
Fix: 343166906
Test: no-op replacement, covered by existing tests
Change-Id: Ie2619949477323d557b8906cf082e86a78512847
Lorenzo Colitticommited 2024-06-05 06:48:50 +00:00
This should speed up BPF map reads by returning the cached value
without needing a system call.
Bug: 343166906
Test: added parameterization to BpfMapTest
Change-Id: Ifc0c5baa80f6d46356434c249749e87fe2f9ec6c
Lorenzo Colitticommited 2024-06-05 06:48:27 +00:00
When running locally, this occasionally fails due to unrelated fds
being opened or closed while the test is running.
Bug: 343166906
Test: test-only change
Change-Id: I437e66077f0471572ec2b215db63a000a4622af5
Lorenzo Colitticommited 2024-06-05 06:48:15 +00:00
When new capability is introduced and added to capaility or
forbiddenCapability by default, module rollback could cause system
server crash since JobScheduler persists network request that contains
new capability that is invalid for old code.
This CL updates capability validation not to throw exception to avoid
system crash in this case.
Bug: 343823469
Bug: 313030307
Test: NetworkCapabilitiesTest
Change-Id: I5708c475f3b4974284531212b77f9788ca9f497e