The NsdManager constructor creates a new thread, which is not
intended to be closed. However, the test in NsdMangerTest and
NsdServiceTest create a new NsdManager instance, resulting in a
large number of threads running during the tests. This can lead
to an out-of-memory error for the tests. To resolve this issue,
use the common singleton thread ConnectivityThread to handle
tasks from the various instances.
Fix: 308544734
Test: atest ConnectivityCoverageTests --test-filter Nsd*
Change-Id: I1908a2bb1bd20da8e0498353bca26f7e89e16626
* changes:
Rename hasCarrierPrivilege... to isCarrierServiceUid...
Detect discrepancies in subIds
Allow carrier service UIDs to access their own WiFi networks.
This method tests whether the UID is the carrier service
UID, not whether the UID has carrier privilege.
Note that in normal operation, the carrier service UID always
has carrier privilege.
Test: NetworkAgentTest
Change-Id: I30f8814cc0419a2d6bdbe75fdc82156516eba026
This tests that the network providers are subject to appropriate
limitations as to what they can set as allowedUids – both in the
positive (can do) case, and the negative (can't do) case.
Test: this
Change-Id: I115e2a4bc02ddcd03ecf2f35130fcb0378da22bd
This reverts commit 30fb9b1ca4.
Reason for revert: Potential culprit for CtsLibcoreTestCases test failures b/311612650
Change-Id: Ie7de97159f92a174476a8fa8ea83e3e01914aea1
As a specialized network, a network with PRIORITIZE_* is not
generally a good default network, and might cause unexpected
charges if allowed to become one.
Test: CSDefaultNetworkTests
Change-Id: I8f7184f80bb987da720bd067862bd7a546a38e26
The profile is modified within startLegacyVpnPrivileged(), e.g.
ipsecCaCert, ipsecUserCert. This causes subsequent calls from
callers such as LockdownVpnTracker to fail.
Add a new test to ensure the VpnProfile is not modified in
startLegacyVpn.
Add testClone in VpnProfileTest.
Bug: 190572822
Bug: 309591931
Test: atest FrameworksNetTests, test before and after fix.
Test: Manual test
Change-Id: Id090e0dd3b9e74a7461ae90e68c41e802b458744
This commit verifies that
- If VPN network preference is set when
- Ikev2VpnRunner is created
- Retrying VPN
- Updating exclusion list
- If VPN network preference is cleared when
- Exiting VPN runner
- NOT_RECOVERABLE happens
Bug: 231749077
Test: atest FrameworksNetTests:VpnTest
Change-Id: I71f48f18fd4556e04c131d5939afaa1ef5a0f814
This is a preliminary change for filtering sockets that is not
in the uid ranges for automatic on/off keepalives. This commit
itself is a no-op change to pass the uid information to
AutomaticOnOffKeepaliveTracker.
Bug: 311119352
Test: atest FrameworksNetTests
Change-Id: I7d96e7a0d3f3054d1409de350420a24378b28cdb
Like NetworkScore, this object is not available on R because
of the absence of the tethering module. Therefore it needs to
be wrapped to be protected against introspection by the test
libraries.
Change-Id: Ia5f84d2926433398cef33d89819a8c6588024ea0
Test: FrameworkNetTests
Writing data saver status to bpf is supported on Android V or
later devices. Thus, read that from bpf if available.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.BpfNetMapsReaderTest
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.ConnectivityManagerTest
Fix: 310801259
Change-Id: Ibd2616328d83f72ee6d2665239c3a44379d1ebf5
SysUi needs to see connectivity diagnostic callbacks to display
"Checking for internet access..." -> "Connected" or "No internet access".
Bug: 307161342
Test: atest FrameworksNetTests, manually connect to a network without internet connectivity,
verify Internet Dialog doesn't get stuck showing
"Checking for internet access..."
Change-Id: I86e2b852ff9e5dfbfc37ba711f477166b0ac6835
Now, every services are cached on MdnsServiceCache, so the
remaining TTL should be checked when retrieving services from
the MdnsServiceCache and have a callback to notify the
MdnsServiceTypeClient about expired services.
Bug: 265787401
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I99da6cc79bdf5df3c899e642e067907501bc9d4f
Currently, BatteryStatsService register netd callback and track radio
power state only for the default network.
So, battery stats are not accurate if cellular and Wi-Fi networks are
active at the same time.
aosp/2561090 updates BatteryStatsService not to register netd callback
on V+ devices.
This CL updates LegacyNetworkActivityTracker to call BatteryStats API
and update radio power state for networks including non default networks
on V+ devices.
Bug: 267870186
Bug: 279380356
Test: atest FrameworksNetTests
Change-Id: I826b3b4046cc7b8aef46c13300854eaf14b1b777
on V+ devices, NetworkActivityTracker adds idleTimer when the network is
first connected and removes idleTimer when the network is disconnected
so that activity tracker can receive netd
onInterfaceClassActivityChanged callback for multiple networks.
Bug: 267870186
Bug: 279380356
Test: atest FrameworksNetTests
Change-Id: I6f3a95c27e3e58f3f60c40065f562d00431a56b1
Following CL adds idleTimer for multiple networks and track activities
including non default network on V+
Current LegacyNetworkActivityTracker uses transport type as an idleTimer
label but this makes it difficult to have multiple idleTimers.
So, this CL updates LegacyNetworkActivityTracker to support using netId
as an idleTimer label.
Bug: 267870186
Bug: 279380356
Test: atest FrameworksNetTests
Change-Id: I0039f5624ae1d142dbacba53aa90ca9bf6d43599
Add helper functions to help compare if MulticastRoutingConfig
has changed.
Test: atest MulticastRoutingConfigTest
Change-Id: I30ed4796efbaafbcf1a273c12a9231ec02bc36f0
A new firewall chain is needed to configure background network
restrictions for apps.
This change only adds the API stubs and traffic controller constants to
make the chain work. Policy changes using this chain will follow in
the framework code.
Test: atest CtsNetTestCases:ConnectivityManagerTest
Test: atest ConnectivityServiceTest
NO_IFTTT=The Lint rule along with the relevant code in Common.h is
being deleted in aosp/2819759
Bug: 304347838
Change-Id: I33e2db6671431f7c576fc931d9f96e684fc1e78a
Also add some toString() methods that were useful in debugging.
Test: new test in CSLocalAgentTests
Change-Id: Ife95815e39d92bbef84b1c5ea75a151882590d09
BpfNetMaps uses java library for updating bpf map as the default code
path.
This is already released to 100% production without any issues.
So this CL removes the old code path from BpfNetMaps.
Note that native_init only opens the bpf maps if sEnableJavaBpfMap is
true.
But if sEnableJavaBpfMap is true, no native code in TrafficController
access the bpf map.
So this CL can remove native_init.
Following CL will remove the nativce codes for old code path.
Bug: 217624062
Test: NetworkStaticLibsTests
Change-Id: Ifba198d9e6f93b53fd1dbf3b2aafb644da0b147d