Calls to setRequireVpnForUids() for Vpn lockdown actually uses a
List instead of a Set of integer ranges.
Add intRangesExcludingUids() to return the needed List of integer
ranges and replace relevant usages of UidRange.toIntRanges() with
it.
Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I61cd4751ce2faeb129daa5ad5da7181e3c1df73c
This is useful to ensure cgroup bpf program is attached,
which would lead to hard-debugging uid stats missing problem.
Test: atest ConnectivityServiceIntegrationTest#testBpfProgramAttachStatus
Bug: 292156770
Change-Id: I16370497484aff29ed41cbb0d160e530731e1a4e
UidOwnerMatchType Java definition moved from BpfNetMaps.java to
BpfNetMapsConstants.java in change I6d7ea044e43180.
Bug: 297836825
Test: presubmit
Change-Id: I4fc28406750cac9143ea47e9304b455ab616d462
Currently, data saver switch is controlled in NPMS, which
calls into NetworkManagementService and netd when switching
status. In netd, BandwidthController manipulates the
bw_data_saver chain to control the overall behavior.
However, this code are all platform implementation, which
are not updatable. In order to migrate data saver switch
from iptables to bpf, this API is needed for Connectivity to
change the implementation to directly write bpf in later
patches.
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Test: atest FrameworksServicesTests:NetworkManagementServiceTest
Bug: 297836825
Change-Id: I71fa41ca739fef8e191fba91b02758ad5f732d5c
Follow-up from aosp/2788197, the CL does not work since
SkipPresubmit annotation is not excluded from TEST_MAPPING for
ConnectivityCoverageTests.
Test: TH
Bug: 302325928
Change-Id: Ibfa509aadc9e54da14738714be46abd25f46f3fb
The TTL check and removal of expired services is currently only
performed when a mDNS query is sent. This can result in expired
services remaining in the cache if no queries are sent. To
address this, the remaining TTL will be checked when retrieving
services from the MdnsServiceCache. Add a new flag to enable
the expired services removal feature. This feature will be
implemented in subsequent changes.
Bug: 265787401
Bug: 304649384
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I30f0eea568ee45d363cc02821de0921d6040f981
Follow-up from aosp/2788197, the CL does not work since
SkipPresubmit annotation is not excluded from TEST_MAPPING for
ConnectivityCoverageTests.
Test: TH
Bug: 302325928
Change-Id: I2d953f19e5d5eb5f5d8fdf4faf335d603bae42a0
I0afdda023208c3f8620cb5b89add66448af596d7 added some assertions
to ensure NetworkAgentInfo can only be accessed from the handler
thread. This is good to eliminate any potential concurrent
accessing problem. Howver, dumpsys runs on binder thread, this
change breaks dumpsys functionality.
Thus, this change:
1. Copy Handler#runWithScissors() and related class
locally since they are @hide methods.
2. Run doDump on the handler thread and waits for return.
Test: adb shell dumpsys connectivity
Test: atest FrameworksNetTests:android.net.connectivity.com.android.server.HandlerUtilsTest
Fix: 303348620
Change-Id: Ic3a22f5d370bbf8c18b1972e86d695b6ad61bd0d
This is catched by errorprone where global variables accessing
is not protected by the declared lock, which could lead to a
potiential race problem where these variables are changed but
cannot be seen for the invocation.
This is also safe since:
1. The method called inside mDefaultNetworks is already holding
the same lock.
2. Multiple global variables are protected by this synchronized
block.
Test: TH
Fix: 181642673
Change-Id: I58e7f124de1f0291e9323ab0b9cf8f52cec32818
The dnsmasq in R might block netd for 20 seconds, which can also
block tethering enable/disable for 20 seconds. To fix this, changing
the timeouts from 5 seconds to 30
Bug: 289881008
Test: TH
Change-Id: Ibed5895b2831465d454854d7250fcc44183596e2
Test coverage of adding and removing a restricted user with and
without lockdown mode, using either setLockdown() and
setAlwaysOnPackage().
This change also refactors makeVpnUidRange() to return a list
and adds makeVpnUidRangeSet().
Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I47a25e9f0337f5c1d5754c279534640cd2753b5c
Root cause not yet located, disable test to unblock TH.
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsHistoryTest
Bug: 302325928
Change-Id: I618090b67e428ab911ec88e7daab30c14cccbf64
EthernetManager is @SystemApi, so cannot be referenced from public
API.
Bug: 303184203
Test: m docs
Change-Id: Ib5cc07c89b4ecfdeae704da131ebb307816e35fa