Fill in downstream type, upstream type, error code and user type to NetworkTetheringReported.
Bug: 153942334
Test: m, flash and boot
Test: atest TetheringMetricsTest
Change-Id: I6ba7d9e512b1ada519f44f9f3a95667e4b0f03c0
isMangedProfile returns true for managed profiles.
But enterprise device can be fully managed like device owner.
Hence check specifically if request is coming on fully managed
device.
Bug: 226966328
Bug: 231071836
Test: ran DevicePolicyManager CTS and ConnectivityServiceTest
Change-Id: I7827466bd61e24ba9c36c3a2e25043257e2ed602
(due to automerge to sc-mainline-prod being turned off,
and tm-dev already having this #define'd)
Test: N/A, trivial, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibf18b2c414f4916301476aa715ef465c8a98ec99
Maciej Żenczykowskicommited 2022-04-29 21:23:30 +00:00
* changes:
Test VpnManager event for CATEGORY_EVENT_NETWORK_ERROR
Test VpnManager event for CATEGORY_EVENT_IKE_ERROR
Test VpnManager event for CATEGORY_EVENT_ALWAYS_ON_STATE_CHANGED
Test VpnManager event for CATEGORY_EVENT_DEACTIVATED_BY_USER
Lucas Linauthored and Gerrit Code Reviewcommited 2022-04-29 08:13:51 +00:00
When adding a listener via the addInterfaceStateListener API, the
expectation is that ethernet service calls that listener immediately
with a list of all interfaces and their respective state. However,
this doesn't work as expectation due to the EthernetManager stores
all registered listeners within one global service listener class,
the new registered listener will be invoked until the state of any
interface has changed.
Instead of storing all registered listeners within one global service
listener class, associate each new registered listener to an instance
of IEthernetServiceListener, and pass it to the EthernetService, that
will be invoked when iterating the state of all existing interfaces.
In order to avoid the scanning of all registered listeners, that would
be slow if there are lots of registered callbacks, moving the service
listener to the ListenerInfo class, where the service listener can
access the executor and listener passed from the caller naturely,
unnecessary to iterate the whole list.
Bug: 229125889
Test: atest android.net.cts.EthernetManagerTest --iterations
Change-Id: I111eba78d1066794c414ab5fb4a31258ea311413
The issue scenario is:
- Telephony registers a network agent and calls markConnected().
- NetworkAgent set mNetworkInfo to CONNECTED and call
queueOrSendNetworkInfo() with mNetworkInfo, but NetworkAgent
don't actually send a message to CS yet because the agent is
not registered.
- Telephony calls unregister because the cellular network is
disconnected.
- NetworkAgent set mNetworkInfo to DISCONNECTED, overwriting the
previous CONNECTED state, and then call queueOrSendNetworkInfo
again with mNetworkInfo. Again this doesn't send any message
because the agent is not connected.
- EVENT_AGENT_CONNECTED arrives. NetworkAgent replies all the
messages in mPreConnectedQueue, but NetworkAgent send two
DISCONNECTED NetworkInfos eventually.
The CONNECTED state should be sent to CS instead of latest state
DISCONNECTED. Thus, make a defensive copy when sending
NetworkInfo change to prevent state overwriting.
Without the NetworkAgent fix, the test will fail with no
onAvailable callback. Because the Network has never been martk as
CONNECTED.
Bug: 228623362
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I11681743d3ff87ff9affd0b7e766894dc5111028
Close the leaking fds before spawning a process. The leaking fds
are unused by clatd and they cause unexpected avc denials. Close
the unused fds before clatd forked.
Bug: 230071136
Bug: 212345928
Test: atest FrameworksNetTests
manual test
1. Connect to ipv6-only wifi.
2. Try IPv4 traffic.
$ ping 8.8.8.8
Change-Id: I4f095cccd999b7dfd7fe87032bf7de81a925a4da
Hungming Chenauthored and Nucca Chencommited 2022-04-27 05:25:22 +00:00
DnsResolverTest#testPrivateDnsBypass is flaky due to data stall recovery
attempting to tear down and reconnect the disconnected connection.
Disable data stall recovery so the test can run without a potential race
condition due to data stall recovery.
Test: atest DnsResolverTest
Bug: 230427128
Change-Id: I3057540d1b261bd51513c568072c8252c5d6959a
(this is safe because on pre-T none of these maps and programs are mainlined
and thus safe to access from mainline code anyway)
Test: TreeHugger, manual
Bug: 218408035
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I23e565d665247f33e084978890a1ee8ffe0fe568
Maciej Żenczykowskicommited 2022-04-23 09:03:06 +00:00
We already have tests that verify this but these new tests
launch the activity repeatedly a few times and verify the
network access as there are multiple race conditions
involving AMS, NPMS and the app that could result in an
inconsistent network rules state.
Bug: 226299593
Test: atest atest tests/cts/hostside/src/com/android/cts/net/HostsideConnOnActivityStartTest
Change-Id: I6372820fd2b21ebd759a3c44c7280c6699726bde
Add a method that allows the caller to specify whether to create a
tap interface with a given specific interface name instead of the
default one. So far only the given name that starts with "v4-testtap"
or "v4-testtun" prefix is allowed. That's helpful to create a clat
interface which always has "v4-" clat prefix in the IpClient integration
test, to verify the callbacks happend on adding/removing clat interface.
Bug: 163492391
Test: atest CtsNetTestCases
Change-Id: I9ea7013fce919cafb719998a123164b5507f9ac0
- For clatd start and stop, use ClatdCoordinator on T+ and Netd on S-
- Fix the unit test for T+ and S- devices
Note that mokito.verify(.., times(1)) is replaced by verify(..)
because times(1) is the default and can be omitted.
See verify in mockito/src/main/java/org/mockito/Mockito.java
Note that this commit needs to be merged with aosp/1956072.
Bug: 212345928
Test: atest FrameworksNetTests
manual test
1. Connect to ipv6-only wifi.
2. Try IPv4 traffic.
$ ping 8.8.8.8
3. Check bpf entries are added
4. Disconnect from ipv6-only wifi.
5. Check bpf entries are removed
6. testipv4.com shows 10/10
Change-Id: I7dfda6eec19de94e4258971effcd8a1210542473
The legacy ethernet config resource check isn't required any more
when the legacy resource cleanup in outside callers finishes, just
read the resource config from Connectivity module, but the value
still can be overlaid with pre-built RRO.
Bug: 214348333
Test: atest FrameworksNetTests
Change-Id: I86f6229343f9d48f0bd822e8086bdc880b81135f
Address aosp/2052545 leftover comments:
- Log a wtf when the received user is unknown.
- Move the code to where it's used.
- PermissionMonitor is using BpfNetMaps for sending traffic
permission. So it’s useless to do the netd null check before
sending permission. Thus, remove this redundant check.
bug: 224775316
Test: atest FrameworksNetTests
Change-Id: I5c1291b6b855747d7900372b800dd039dd0730fe
A UID can be a concatenation of a UserID with a 5 digit package UID.
E.g., Bluetooth under User10 would have UID 1001002. This CL removes the
UserID (if any), before checking against BLUETOOTH_UID.
Bug: 228598338
Test: m
Change-Id: I532583345cc9ab474fc848a3ede6be9d8be9c5b0
TestOnly flag allows the test to read restricted @Readable setting
ALWAYS_ON_VPN_LOCKDOWN_WHITELIST.
BUG: 177239688
Test: atest com.android.server.ConnectivityServiceTest
Change-Id: If41708ad31de9cec3a102b4de4d237e96a448ef1