When updating lockdown UID ranges, do not remove a UID from lockdown
if it is still present in any of the previously-supplied ranges that
have yet to be removed. This allows supplied lockdown ranges to stack
properly, providing an assurance that a UID will remain subject to
lockdown until all of the ranges including it have been removed.
Change-Id: Ia95724cd19040f83cea2c169a2585ab5dbdddbac
NsdShim is added to make the NsdManagerTest buildable in some old
branch. As a part of migrating to new branch, the nsdShim is not
needed anymore.
Test: atest CtsNetTestCases:android.net.cts.NsdManagerTest
Change-Id: Ia6a9663163a111aa070d88f585ab04918443cb8a
Follow-up from commit I1b32d9e069a7b10664065e138c75c6bfe7928f23,
the wait() not in a loop could be errorprone if the call to wait()
unblocks because of a spurious wakeup.
Test: atest CtsNetTestCases:NetworkStatsManagerTest
Bug: 289112440
Change-Id: Ic20ea5a42f3125668f80b13285b43146ae929cbc
Currently, testUidTagStateDetails relies on the test URL return
enough data (~100k) to ensure untagged traffic is not too much
to cause flaky. But aosp/2575590 change it to read only first few
bytes to speed up the test which would break this assumption.
Thus in this change:
1. Revert partical changes of aosp/2575590
2. Use BufferedInputStream to speed up test instead, which speed up
testUidTagStateDetails from 2032ms to 902ms in local trials.
Test: atest CtsNetTestCases:NetworkStatsManagerTest
Bug: 289112440
Change-Id: I1b32d9e069a7b10664065e138c75c6bfe7928f23
To reduce the multi-thread access to MdnsServiceTypeClient, the
query task scheduling should be replaced with a delayed message.
This will allow the synchronized lock to be removed in future
changes.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: I340fe1a407947be860cdcd9c7c76829417a32e4c
Limit the translation code on NAT-T keepalive because the
intention of the translation is design for NAT-T keepalive.
The translated packets is also NAT-T packet data which should
not apply to TCP keepalive.
Bug: 196453719
Test: atest FrameworksNetTests
Change-Id: I0951621edc9f918199d82365a6f1c03617ddd806
There are more than 1 interaction inside verifySetupPlatformVpn.
The original code does not actually wait for the target
interaction with Executor.schedule(). The interact may happen
after reset the mocking object. This will leave a unexpected
interaction in the follow up verification and cause a flaky
test.
This test was fine in the initial patch, but becomes failed
after the time unit used in Executor.schedule() was changed
to milliseconds for data stall recovery. Both interactions
for data stall ones and non-data stall ones will be captured
together after that.
Bug: 289961869
Test: atest VpnTest --rerun-until-failure 20
Change-Id: If24e323b366bb15b81fe9fa554fa7ccc852ba6f1
To ensure that all access to the MdnsServiceTypeClient is done on
the handler thread, a handler thread check must be added to all
public methods in the MdnsServiceTypeClient. This will allow the
synchronized lock to be removed in future changes, and it will
also ensure that MdnsServiceTypeClient can access MdsServiceCache
properly.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: I0206874eb0acdf0272b8ad23d29f3e764bfdec38
The MdnsServiceTypeClient is now created using a SocketKey, so
the MdnsServiceCache should also use the SocketKey to deal with
the caching services.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: I6165ffd420a39e750c06778b4851142a3ba3cf44
After numOfQueriesBeforeBackoff query, the mDNS discovery logic will
enter backoff mode. In backoff mode, the query frequency will be
updated to max(20, 0.8 * shortest remaining TTL) seconds. It will help
to reduce mDNS query frequency in certain use cases.
Bug: 284480315
Test: atest CtsNetTest FrameworksNetTests
Change-Id: Iac8baaaf58cf9b3b8e67e1cd80402fdecde1d3d4
This is no-op refactoring but allows subsequent
changes to use modern JUnit4 functionalities such
as @BeforeClass annotation.
Test: atest HostsideNetworkCallbackTests \
HostsideConnOnActivityStartTest \
HostsideSelfDeclaredNetworkCapabilitiesCheckTest \
HostsideVpnTests HostsideNetworkPolicyManagerTests
Bug: 289002798
Change-Id: I503c13ffcb239c4535781ba5d660a3280b7a395b
[MUST_SLEEP]ActivityThread may not have time to set the updated
proxy into properties yet and cause flaky. Wait for some time in
the test to deflake the test.
Bug: 286551100
Test: com.android.cts.net.HostsideVpnTests
Change-Id: I74d3d7378adcf12c094cb9c0706579d6e0b0826b
Data stall recovery in VPN does not rely on the data stall
event now. Update the tests accordingly.
Bug: 289746779
Test: atest FrameworksNetTests
Change-Id: I4d2d96fe2f76706512325b6653b3e7cced10f207
Repeated fields are only supported on T+ and the metrics in
KeepaliveStatsTracker contains repeated fields. Hence, guard the write
with a T+ check.
Bug: 289344384
Test: Manual test
Change-Id: If3be75292b5a79aa753bddb772fe2c52c9dde994
This will hopefully help provide more information for debugging b/272147742.
Bug: 272147742
Test: atest RateLimitTest
Change-Id: I58ca7ee62d34302eb96056fced5bbc2f9a3e2e72
This commit translates the address of keepalive packet to v6
in order to make NATT keepalive work on v6 only network.
Sending a v4 NATT keepalive on a v6 only network is bogus if
hardware does not translate the packet automatically. Network
may drop the packet or reject the attempt by hardware. This
results in ERROR_INVALID_IP_ADDRESS and stop the keepalive
request.
Bug: 196453719
Test: atest FrameworksNetTests
Test: Manually connect to v6 only network and check if the
keepalive packets are sent
Change-Id: I798c5d48661d8151b19902435732f465b5aa725b
This should be reverted as soon as it is merged into U
and the build request is submitted.
Bug: 286649301
Ignore-AOSP-First: udc-dev only change
Test: NetworkAgentTest, TH
Change-Id: I2cbe990675b109e4ba744101dd7dbbb20229376f
This patch flags off the functionality added by aosp/2162425
in the wake of b/286649301 where a race in ConnectivityService
breaks WiFi connectivity until reboot.
Bug: 286649301
Test: NetworkAgentTest
ConnectivityServiceTest
(cherry picked from https://android-review.googlesource.com/q/commit:a16607f421ecfbf37ef8fb2fa96d4d285df9e77b)
Merged-In: I96d755445f6e1f88bb71a7d32742e87dae185250
Change-Id: I96d755445f6e1f88bb71a7d32742e87dae185250
This reverts commit 4bc9fa6b8c.
Reason for revert: b/288450518
Some iterations over mNetworkAgentInfos result in networks being
disconnected, which removes them from mNetworkAgentInfos during
iteration. This crashes with NPE or OOB exceptions.
Bug: 286649301
Bug: 288149251
Bug: 288450518
(cherry picked from https://android-review.googlesource.com/q/commit:3160bc0825490353d79c6586e21a7fc5893c678d)
Merged-In: I6e0b5b614d9e88267db77cb807ae4bf09f88c0f6
Change-Id: I6e0b5b614d9e88267db77cb807ae4bf09f88c0f6