aosp/2605757 updated isDefaultNetworkActive returns false when there is
no default network.
But this change was not merged to U release branch and this change was
not well tested by dogfooding.
So this CL reverts the isDefaultNetworkActivity behavior change.
Bug: 279380356
Bug: 291870075
Test: atest FrameworksNetTests
Change-Id: Id88662faea9eeaba93d59ab2729f6204a3631ab1
aosp/2605757 changed onNetworkActive callback behavior on U+ but this
change was not merged to U release branch.
This CL reverts the behavior change and keep the current behavior on U+.
Bug: 279380356
Bug: 291870075
Test: atest FrameworksNetTests
Change-Id: I91ccc7ee93f0827986401f316997b4a2df11318f
To cache services and respond quickly, the MdnsServiceTypeClient
should add all services to the MdnsServiceCache and remove any
services from there as well.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: If0a9e6b563a0992ac25b8cde7f3beb00700f1c11
Now that all access to MdnsServiceTypeClient parameters is
running on the handler thread, the synchronized lock is no
longer necessary. Therefore, the synchronized lock can be
safely removed from MdnsServiceTypeClient.
Bug: 265787401
Test: atest FrameworksNetTests
Change-Id: I5cd28aa738ea3c199b75097f4583e98be86a6ee7
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
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 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 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
Change-Id: I6e0b5b614d9e88267db77cb807ae4bf09f88c0f6
In the previous design, the network could be null for some
MdnsServiceTypeClient (tethering interfaces). However, the
MdnsMultinetworkSocketClient is designed to send packets on
specific networks. This means that if there are multiple
tethering interfaces, packets will be sent to unnecessary
sockets. Now, the MdnsServiceTypeClient is created by the socket,
which can identify which socket is the target for sending
packets. Therefore, the design should be updated to send packets
only on the specific socket.
Bug: 278018903
Test: atest FrameworksNetTests android.net.cts.NsdManagerTest
Change-Id: Id87e6d202599c57620281a6761d3c56acd2c929c
When config_notifyNoInternetAsDialogWhenHighPriority is on, the
LOST_INTERNET notification intent should be fired immediately
rather than as a pending intent.
Bug: 281970908
Test: Improve test for this in NetworkNotificationManagerTest
Change-Id: I88565839a12a1ab4b096f763250944ebaf6c5349
The v6 address is generated from the prefix when clat is started.
The address should be reset when clat is stop.
Test: atest FrameworksNetTests
Change-Id: I943d4efba85dda556dd1ec852322caaf9470e87b
When a network was explicitly selected, the user just tapped it and
is likely waiting for it to connect. A shorter timeout is therefore
more appropriate for these.
Bug: 281970908
Test: New test in ConnectivityServiceTest
Change-Id: I99a263960cbc9292868fc4bb46a4f3b2f3c71541
This CL changes the behavior as follows.
Before this CL, isDefaultNetworkActive returns true if there is no
default network.
After this CL, isDefaultNetworkActive returns false if there is no
default network on all releases.
Before this CL, LegacyNetworkActivityTracker does not call
onNetworkActive callback for networks that tracker does not add the idle
timer to (e.g. ethernet, cell network configured with activity tracking
disabled).
After this CL,
On T-, onNetworkActive keeps the current behavior.
On U+, onNetworkActive is called regardless of the idle timer existence. This behavior is consistent with ConnectivityManager#isDefaultNetworkActive, which always returns true for a network that has no activity tracking.
Bug: 267870186
Bug: 279380356
Test: atest FrameworksNetTests
Change-Id: I7b1d493fea0ab028b53a3d640a58a00ebbdcc143
Add options to control whether only send IPv6 packet on IPv6 only
network. In some use case, IPv6 query should not be sent on a dual
network.
Added a small improvement to send an ANY query if both SRV & PTR
records are needed.
Bug: 284480254
Test: atest CtsNetTest FrameworksNetTests
Change-Id: I8f55db6f5e8ae606ac167fb363bc9b2fb9b5fc14
This is a part of preliminary work for adding tests in the
follow up commit.
Bug: 196453719
Test: atest FrameworksNetTests
Change-Id: Ibf1bd267c4c144f533380eeafc6a6144f64da483
When a keepalive is paused, it should sit on its hardware
slot for this network to make sure that it is possible to
resume later, even if it means other keepalives can't be
started at the same time.
Test: update AutomaticOnOffKeepaliveTrackerTest for this
Fixes: 268149573
Fixes: 283886067
Change-Id: Ida325bdea198d751483a83ee5d9ec26e39812137