Android 16 introduces restrictions on the DeviceConfig flags that
can be modified by the shell user by removing the WRITE_DEVICE_CONFIG
permission from this user and replacing it with the
WRITE_ALLOWLISTED_DEVICE_CONFIG permission; with this permission,
only those flags that have been allowlisted can be modified. This
commit adds the ALLOWLISTED permission to any test that explicitly
adopts the shell permission identity with the WRITE_DEVICE_CONFIG
permission; the WRITE_DEVICE_CONFIG permission is not removed to
ensure tests do not break when run on previous platform releases
without the ALLOWLISTED permission.
Bug: 364083026
Flag: TEST_ONLY
Test: Manually ran all modified tests
Change-Id: Iad68063550f99f3dc78ac2f0483dad98a8a93f2e
Michael Groovercommited 2024-11-18 23:28:24 -06:00
This reverts commit 5714031dcc.
Reason for revert: breaks MCTS as tests are run with older tradefed that does not have the option: b/378710131
This can be rolled forward after cherry-picking the tradefed change to older branches.
Change-Id: Ib9b4fe3b1c5393cd6e802eee4899457497d79ca7
Remi NGUYEN VANauthored and Gerrit Code Reviewcommited 2024-11-18 00:57:58 +00:00
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.
The AndroidTest.xml file is shared by several modules, including
CtsNetTestCasesMaxTargetSdk33. Now all modules can pass now.
Fixes: 365184699
Test: atest CtsNetTestCasesMaxTargetSdk33
Test: atest --user-type secondary_user CtsNetTestCasesMaxTargetSdk33
Test: atest --user-type secondary_user_on_secondary_display CtsNetTestCasesMaxTargetSdk33
Flag: TEST_ONLY
Change-Id: I905646aca1a3d3ed2a80bbe3a8c67ec0139e7562
This commit removes the redundant type and caller uid
checks in TrafficStats to address the review feedback at
aosp/3313055.
Test: TH
Bug: 343260158
Change-Id: I0ed6e850835136c9a324efd7271dd80a34160aa6
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.
Fixes: 364636108
Test: atest CtsNetTestCasesInternetPermission
Test: atest --user-type secondary_user CtsNetTestCasesInternetPermission
Test: atest --user-type secondary_user_on_secondary_display CtsNetTestCasesInternetPermission
Flag: TEST_ONLY
Change-Id: Ib559c8465846f687a725b85c330f398e81cbe567
Similar to ag/19534833, this CL ensured that CtsNetTestCasesInternetPermission builds its helper apks.
Bug: 364636108
Test: atest CtsNetTestCasesInternetPermission
Flag: TEST_ONLY
Change-Id: I989126cc027e317e228fad197b6e9f752e8e4acb
Enable error-prone checking for CtsNetTestCasesDefaults to
catch NullablePrimitive errors during build time. This is
to address review feedback at aosp/3292201
Test: m CtsNetTestCases
Bug: N/A
Change-Id: I009f0e4ede02a933570cfcc8c563808dbf436193
This adds tests for bugs that were introduced when we enabled
early native network creation. The tests pass on current builds
because the feature is disabled, but break if the feature is
re-enabled without fixing the races.
Specifically:
- Add a test that registers/unregister/registers agents in a
loop. This checks for a race between unregister() and
register() which exists because unlike register(),
unregister() has to wait for the agent channel to be
connected.
- Add a test for calling unregisterAfterReplacement multiple
times on the same interface. This tests for the race seen
in b/286649301#comment6 , where calling
unregisterAfterReplacement twice and then registering a third
agent will cause the second agent to be torn down after the
third is registered.
Bug: 296355968
Test: test-only change
Change-Id: I3d798209740273e5ce59b278af41dd2ad9470916
Lorenzo Colitticommited 2024-10-31 16:26:14 +09:00
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.
This change includes:
1. Disable the service-side cache flag if the client-side flag
is enabled.
2. Since the apps don't have enough permission to check the
feature flag from DeviceConfig. Provides a binder interface
for returning per-UID config,
which only returns cache enabled if the SDK level is V+
or the app's target SDK is V+.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2
Follow-up from aosp/3249945. If the system caller queries stats
for other UIDs, the caller would get UNSUPPORTED.
This follows the official documentation, where the API would
not return stats for all other UIDs.
However, partners or other legacy callers might already depend
on this undocumented behavior. Changing this behavior might
damage existing apps.
Thus, this change reverts the behavior change introduced at
aosp/3249945 and allows a system caller to query stats for
other UIDs.
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.TrafficStatsTest
Bug: 372851500
Change-Id: Ia7ea051f7b0b6349ffcb890c300362bbfbdee3dc
Networks can use widely varying timeouts for their connections. Because
cellular modems use a lot of power, having this configurable is more
useful for tuning this to an optimal value for power drain.
Adding a similar configurable value for WiFi for parity.
Test: atest ConnectivityCoverageTests:\
android.net.connectivity.com.android.server.CSNetworkActivityTest
Bug: 373733012
Change-Id: I2418f09233b2e3fa4e9cdd8fbb6149a35106b735
Currently, if the app's target SDK is V+, the rate-limit cache is
enabled regardless of whether the kill switch is enabled or not.
This creates problems if there is a need to disable the feature
entirely.
Thus, this change makes the kill switch override the target SDK
level. This is necessary for follow-up changes to enable
the client-side cache and disable the service-side cache
simultaneously.
This change also removes the need of initializing/clearing the
caches when the cache is entirely disabled.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: I38bdfe00220f59712ca4b095fe4e7a3731320708
The PacketReader should be stopped after the test completes.
Otherwise, it may lead to a memory leak due to the creation of
excessive file descriptors.
Test: atest NsdManagerTest
Change-Id: I3015dbe9d8a25e3370b32935787708e1e88fbbc7
This change includes:
1. Rename binder interfaces.
2. Use a dedicated class to pass the result of
get{Total|Iface|Uid}Stats, as it is 25% faster than passing
a NetworkStats object through the binder interface.
3. Remove the binder interface only used by the test.
4. Remove NetworkStatsBinderTest on R and S, since the binder
interface is removed, the mainlined service does not run on
those versions and the chance of breaking these tests on
R and S is low.
5. Remove useless TODO comments.
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 372851500
Bug: 343260158
Change-Id: Ibd79a17218f54f0117d8ef5d7b9ec6073356f923
On some networks, telephony may teardown its network
(unregisterAfterReplacement) when wifi is toggled to change the MMS
capability.
Update testRejectUnvalidated_TearDownNetwork to take that into account:
right after toggling wifi to make it unvalidated, wifi may still be
default if mobile data is being reconnected. Wait for mobile data to
reconnect and validate in that case.
Bug: 296403855
Test: atest
Change-Id: Ief46bed41ecb23d75c9a1f58e7a272e7f3de7caf
Add a uid and package name to TetheringRequest to keep track of which
app the request belongs to, and also convey this information to Wifi
for later use with resource conflicts.
Bug: 216524590
Test: atest TetheringManagerTest TetheringServiceTest
Change-Id: If963694cb1bbd831ba379a76043825c94ef9d67a
Quang Anh Luongcommited 2024-10-23 15:52:03 +09:00
When adding a dependencies, if the variants don't match, but the
dependency only has 1 variant anyways, soong will always use that
variant. This makes it hard to add new variants to soong, because the
1-variant fallback stops being used and you start getting missing
variant errors. Make changes to bp files such that all dependencies
correctly specify the variant to use.
Bug: 372091092
Flag: EXEMPT refactor
Test: m nothing
Change-Id: I8d4f59044f268088b44357d27322abbdcdc3001c
aosp/3218864 fixed the crash when ranges are removed from a
destroyed network, but did not fix the case where the ranges are
added to a destroyed network.
This can happen if a multilayer request is filed when a network
has already been destroyed.
Fix: 368989698
Test: updated existing tests for this bug
Change-Id: I7184eaa01141f56b7ad774277c7dee03d5812298
Lorenzo Colitticommited 2024-10-22 11:41:21 +00:00
This will mark connectivity diagnostics files collected on failure as
CONNDIAG type, so they can be easily identified in test results. Having
a separate type will also allow automatically filtering them so they can
be pulled across test results and flake stats can be aggregated (for
example to identify which wifi access points are typically flaky).
The CONNDIAG type was added in change ID:
Ib56decb7660e9f93844337fa7a5bf9b00610c1c6
See that change for details of the option on FilePullerLogCollector.
Test: atest
Change-Id: I00fe23acf308723583e8ec82a032b42475a68173
This is a refactoring of the test to adopt synchronized methods.
This is needed for the follow-up changes to get attributes of
the network prior to generating the network traffic.
This change includes:
1. Use synchronized methods in AutoReleaseNetworkCallbackRule for
better managing request/release networks and also improves
readability.
2. Decouple the steps of requesting network, set attributes and
generating network traffic.
3. Clearer fail messages since the test can directly throw exceptions
to reflect the failures of a specific procedure.
4. Remove the global timeout, which makes the test more likely
to be flaky when individual steps take longer to complete.
5. Use capabilities in the callback instead of synchronous calls to
fetch attributes.
6. Use @RestoreDefaultNetwork annotation to enforce default network
restoration.
Test: atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest \
--rerun-until-failure 30
Bug: 368624224
Change-Id: I3effa3c032afb345f1c0c4b73b51397d18970a19
The timerfd delivers timer expiration notifications via a file
descriptor, which can be used to implement delayed callbacks.
Create a JNI class to interface with the timerfd system calls.
Bug: 366373064
Test: m
Change-Id: I0ae7a4cf618838e614b2fa4523b55a4d0e8f74e2