* changes:
Add support for TestInterfaceMode to EthernetTracker
Move call to setEthernetEnabled inside setIncludeTestInterfaces
Add support for TestInterfaceMode in setIncludeTestInterfaces
Treehugger Robotauthored and Android (Google) Code Reviewcommited 2025-07-23 14:16:42 -07:00
This will allow EthernetManagerTest to include test interfaces as
NCM-only interfaces.
Note that at this point, setting any TEST_INTERFACE_MODE includes a
test interface in both MODE_ETHERNET and MODE_NCM (equivalent to
setIncludeTestInterface(true)) as the mode is not propagated further
than EthernetServiceImpl.
Test: TH
Flag: EXEMPT mainline
Change-Id: I52a36ebb29bc27a21c7521c1cd9bd186001ac6c5
This patch added EthernetPortSelector class that is used to select a
specific ethernet port by interface name or MAC address.
Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: I050dc1f484115fdedda349cc2e1a44f4c5fda6db
Before moving VCN code, add the new code locations to the
"visibility" fields of Connectivity dependencies.
Bug: 379938062
Flag: EXEMPT; visibility changes
Test: presubmit
Change-Id: I51becaacb93d5e43b8b8234b80cb9b272181ad01
This patch updates prefix for Persistence and MeteredOverride IntDef for
consistency.
Test: build
Bug: 397536853
Flag: EXEMPT mainline
Change-Id: Ic39c8d74900929f6ac95795bea2fbe9c686ec533
This patch adds methods to get metered override and persistence config
in human readable string in EthernetConfiguration.
This allows more informative logging.
Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: Ia5a2f4b9f624bfc1c96b197533426925dacfa554
And pass it through to EthernetListener. This will be used to optionally
include callbacks for NCM interfaces which are not tracked by the regex
in tests.
Test: TH
Flag: EXEMPT mainline
Change-Id: If388a37911d3b8ceb2be79f8d303f37560b2678b
This class can be used with ConnectivityManager#requestNetwork to
request connecting to a specific Thread network from system apps.
Bug: 377258309
Flag: com.android.net.thread.flags.thread_mobile_enabled
Change-Id: I80cb992380236b045e4e331b9861274d8cd10cfd
This patch added persisted logic to EthernetConfiguration, which allows
ethernet configuration to be set to be persistent across boot or not.
Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: I6e96dec0f802cf1a58e61bffb6c1dac34a0a91a5
This patch changes the name of class EthernetPortInfo to
EthernetPortState.
Bug: 397536853
Test: build
Flag: EXEMPT mainline
Change-Id: I7f42170cdde33ca31dea3d622678565ea5dc1026
This change address api council review feedback for ag/33705589,
which includes:
1. Mirror `@Transport` annotation in NetworkCapabilities to
the NetworkTemplate class, because such annotation is
not visible to NetworkTemplate class.
2. Add @Transport annotation for the APIs.
3. Add @throws in the javadoc.
Flag: com.android.net.flags.netstats_transport_type
Test: m
Fix: 424088371
Change-Id: I2c3ed5e1abc6d647bbb5af99446e3d75ed167f05
In case there is a bug after rolling out transport
types support in the NetworkIdentity. Add a kill switch
to stop writing transport types to mitigate the
impact if any.
Flag: EXEMPT the change is the kill switch
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkIdentity*' --update-device
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkStats*' --update-device
Test: atest ConnectivityBenchmarkTests
Test: atest FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Test: Manual:
1. Download files
2. adb shell device_config put tethering store_transport_types -1
3. reboot and check Data Usage Settings page.
Bug: 419123367
Change-Id: I52791f6fe5207021748641cf0719055533b5d511
This is needed for counter-part modules to query data usage
with specified transport type.
Flag: com.android.net.flags.netstats_transport_type
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkTemplate*' --update-device
Bug: 419123367
Bug: 420531377
Change-Id: I7778de815bec947be3e6abbd6269e1727de5c550
This is needed for counter-part modules to query data usage
with specified transport type.
This is kept hidden and will be exposed in follow-up
CLs.
Flag: EXEMPT controlled in the counter-part CL
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkTemplate*' --update-device
Bug: 419123367
Bug: 420531377
Change-Id: I503b4d7307d008a64a14aa713d9714428e399809
This change verifies that:
1. For a given match rule, if transports are specified, a deduced
transport type should be included. For example, if MATCH_WIFI
is specified, TRANSPORT_WIFI should be included if at least one
transport is specified.
Flag: EXEMPT implemented in the counter-part CL
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkTemplate*' --update-device
Bug: 419123367
Change-Id: Ic8375e50c3587ef2b757d1c3241f97482d93808b
This change updates NetworkIdentity to have NetworkCapabilities
transport types for improved network identification, and updates
NetworkIdentitySet for backward compatibility with older data.
Flag: EXEMPT implemented in the counter-part CL
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkIdentity*' --update-device
Test: atest ConnectivityCoverageTests --test-filter \
'NetworkStats*' --update-device
Bug: 419123367
Change-Id: I26cc770d90b4687d832dd029d9a11db03404db39
This patch adds EthernetPortInfo class which represents information of
an EthernetPort object.
This class is mainlt used in network callbacks.
Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: I8ab9fa934a710080163d951bb6619050ca38a2ee
This patch adds MAC address support for EthernetNetworkSpecifier under
@hide flag.
After adding the support, EthernetNetworkSpecifier will be able to be
matched by MAC address in addition to existing interface name match. The
specifier can be satisfied with either MAC address and/or interface
name.
Bug: 397536853
Test: atest CtsNetTestCases:android.net.cts.EthernetNetworkSpecifierTest
Flag: EXEMPT mainline
Change-Id: Ibe55411ad0d3fdded6e25c9f33d9898e3eab3a3c
Avoid duplicate calls to getValues for non-matched entries. Performance
experiments suggest it is worth the cost of the additional BitSet
allocation to keep track of what matched. BitSet performs slightly
better, and allocates/uses/frees less memory, than a boolean array.
Bug: 416650909
Test: atest ConnectivityCoverageTests:android.net.connectivity.android.net.NetworkStatsTest
Flag: EXEMPT bugfix
Change-Id: I932375798a58f8ee59b6028faade5fa88ba053cb
This commit adds the implementation in NsdService to support offloading
only advertisement requests. This is a temporary solution to facilitate
the migration of TV devices to APF-based mDNS offload.
Test: TH
Flag: EXEMPT bug fix
Change-Id: I7b8535956e701a34fca31908b8b21e9ab731505c
Skip including the subtype PTR query for both announcement and offload
packets. This is necessary because devices like Googlecast have
numerous subtypes. Including these subtypes in the packets can easily
exceed the MTU limit. Furthermore, the Wi-Fi firmware has limited RAM
available for hardware offload, and including subtypes would consume
excessive memory resources needed for the offload code.
Test: TH
Flag: EXEMPT bug fix
Change-Id: I2575659983579da0bbf4ff104ba5b8111ee9585e
This commit makes the NsdManager.registerService() API public. This
change will enable developers to implement more customizable mDNS
advertising behavior in their applications.
Bug: 373270045
Test: atest CtsNetTestCases:NsdManagerTest
Flag: com.android.net.flags.mdns_advertising_improvement
API-Coverage-Bug: 415202964
Change-Id: I32359f7265b3597defd57123ecff0deaef0011f8
The NsdManager.registerService() method was originally scheduled to
become a public API in the 25Q2 release. However, this transition did
not occur as planned. The current target for making this method a public
API is the 25Q4 release. In the interim, the @UnsupportedAppUsage
annotation is being added. This is necessary to support an internal
MediaShell use case for the 25Q2 TV release. This change marks the API
as available in the dex so callers can call without being blocked by
hidden API restrictions. This API will be marked as public API
immediately after this change for 25Q4.
Test: TH
Flag: EXEMPT no logic change
Change-Id: I8e6e33ca224f459c3d8344c05ea6d6e5a4556a8d
This patch adds EthernetConfiguration class which represents a
static configuration and network capabilities of a configured ethernet
network interface.
EthernetConfiguration is used ONLY internally to store and track
ethernet configurations, and serves different functionality as
EthernetNetworkUpdateRequest.
Bug: 397536853
Test: atest ConnectivityCoverageTests
Flag: EXEMPT mainline
Change-Id: Ib175347096db25b9f2180a2e526746f1f3cf6ceb
Getting the network stats required making 3 full copies of all the
network stats since boot. Reorganize the code so we only have to
allocate incremental network stats objects.
Flag: EXEMPT bugfix
Bug: 399154099
Test: atest ConnectivityCoverageTests
Test: atest NetworkStatsIntegrationTest
Change-Id: Id531c4ffd6e0d127b8aaac38bda6a89a3d700c64
Updated the comment in OffloadServiceInfo to accurately reflect that the
ServiceType field should not include the ".local" suffix.
Test: TH
Change-Id: I8158b413dabeacdda2585ea065b2db2d4ca95e8f
The flag, used in the newly exposed AdvertisingRequest, allows
skipping the probing step when the service name is known to be unique
already.
This allows implementing RFC 6762 section 8.1 that specifies probing
SHOULD be skipped if it is known via other means that the record set
is unique.
Bug: 384841047
Test: atest CtsNetTestCases:NsdManagerTest
Change-Id: I19d67ff2863af631bd9c2f518b004f1688ac5f87
This allows obtaining the hostname that is pointing to the address
records, which were already available though #getHostAddresses.
This is covered by existing CTS tests, for example the
servicesWithCustomHost_customHostAddressesFound test in NsdManagerTest.
Test: atest CtsNetTestCases:NsdManagerTest
API-Coverage-Bug: 384841047
Change-Id: Ib939c1977a76d8d98c9b4f79da6a1a6b0acf6a87
to avoid possible deadlock from following DevicePolicyManager.isDeviceOwnerApp
move SYSTEM_UID checking ahead.
Change-Id: I182cadb175ca5028b6fe8e7f6316dcd349e32573
When the build system flag RELEASE_MOVE_VCN_TO_MAINLINE is true,
VCN framework lib will be included in the tethering boot classpath
fragment and the VCN service lib will be included in the
service-connectivity.jar
Bug: 375213246
Test: flag enabled: VCN libs are in the tethering module
flag disabled: VCN libs are in the platform
Flag: RELEASE_MOVE_VCN_TO_MAINLINE
Change-Id: If0239eb1684b861b63794762915dab0d62379885
This change introduces client-side rate limiting for TrafficStats
APIs to address a performance issue caused by excessive calls,
resulting in high CPU usage and binder contention. By caching
traffic statistics on the client side, we reduce the frequency
of calls to NetworkStatsService, improving overall system
performance and mitigating potential privacy concerns related
to traffic analysis fingerprints.
This client-side caching mechanism will be disabled and gradually
enabled through a feature flag rollout.
Test: atest CtsNetTestCases:android.net.cts.TrafficStatsTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest \
ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
ConnectivityCoverageTests:android.net.connectivity.android.net.TrafficStatsTest \
CtsNetTestCases:android.net.cts.IpSecManagerTest#testIkeOverUdpEncapSocket \
CtsNetTestCasesUpdateStatsPermission:android.net.cts.networkpermission.updatestatspermission.UpdateStatsPermissionTest#testUpdateDeviceStatsPermission
Test: adb shell device_config put tethering trafficstats_client_rate_limit_cache_enabled_flag [-1|1]
Bug: 343260158
Change-Id: If8a252d8d01c1545b23fdc7a00010f249ca09dc2
This is to address review comments at aosp/3324247, where
the test only methods are pretty much always single-threaded.
Remove the synchronized block accordingly.
Test: TH
Bug: 372851500
Change-Id: I14209b090c584912fcb87f5734f57ef3db7b0f3c
This patch exposes Connectivity libraries to allow migrating VCN to
its own non-updatable framework and service libraries. It also
creates a utility library for VCN.
Bug: 369703242
Test: atest FrameworksVcnTests && atest CtsVcnTestCases
Flag: EXEMPT no functional change
Change-Id: I1981f1cc824dcf426a76a0af8e4e3460fccb754e
This commit removes the redundant type and caller uid
checks in TrafficStats to address the review feedback at
aosp/3313055.
Test: TH
Bug: 343260158
Change-Id: I0ed6e850835136c9a324efd7271dd80a34160aa6
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.
This change includes:
1. Disable the service-side cache flag if the client-side flag
is enabled.
2. Since the apps don't have enough permission to check the
feature flag from DeviceConfig. Provides a binder interface
for returning per-UID config,
which only returns cache enabled if the SDK level is V+
or the app's target SDK is V+.
Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2