android_packages_modules_Co.../tests/unit/java/com/android/server
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Junyu Lai c00cf63e8a Add metrics for requests satisfied by local networks
This change introduces `SatisfiedByLocalNetworkMetrics` to count the
number of `NetworkRequest`s per UID that can be satisfied by a
local-only network.

The purpose is to gather data on how many applications register callbacks
that would match non-thread local network connectivity.
This data helps in understanding app behavior and can inform
future development of local-only network features particularly
for the backward compatibility of existing NetworkRequests.

- A new class `SatisfiedByLocalNetworkMetrics` handles the counting and
  logging logic.
- `ConnectivityService` calls into this class upon `NetworkRequest`
  registration.
- Counts are logged to statsd.

Sample dumpsys output:
  SatisfiedByLocalNetworkMetrics: {LISTEN={10217=2}}

Bug: 406172997
Flag: EXEMPT controlled by the `satisfied_by_local_network_metrics`
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.CSSatisfiedByLocalNetworkMetricsTest \
      ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatisfiedByLocalNetworkMetricsTest \
      --update-device
Test: m statsd_testdrive && statsd_testdrive -e 10247
Test: Manual: atest dumpsys connectivity

Change-Id: I62f6299a1c726537b373e3e80d41a494323f3cf2
2025-07-01 16:01:28 +08:00
..
connectivity Merge changes If5f9b5e8,I2ae559df into main 2025-06-26 17:47:59 -07:00
connectivityservice Add metrics for requests satisfied by local networks 2025-07-01 16:01:28 +08:00
ethernet Add EthernetPort#matches(interfaceName) 2025-06-18 14:49:41 -07:00
net Add kill switch for storing transport types 2025-06-10 17:57:11 +08:00
BpfNetMapsTest.java Creating interface name to index tracking for Bpf Maps. 2025-03-13 17:04:54 +00:00
CallbackQueueTest.kt Rename getShrinkedBackingArray to getMinimized* 2024-08-02 19:27:41 +09:00
ConnectivityServiceTest.java Add metrics for requests satisfied by local networks 2025-07-01 16:01:28 +08:00
IpSecServiceParameterizedTest.java packages/modules/Connectivity: remove usages of deprecated Mockito matchers 2025-03-10 02:16:21 +01:00
IpSecServiceRefcountedResourceTest.java packages/modules/Connectivity: remove usages of deprecated Mockito matchers 2025-03-10 02:16:21 +01:00
IpSecServiceTest.java packages/modules/Connectivity: remove usages of deprecated Mockito matchers 2025-03-10 02:16:21 +01:00
IpSecXfrmControllerTest.java [XFRM_MSG_NEWSA] Support polling SA state with netlink message 2023-12-11 18:43:34 +00:00
IpSecXfrmControllerTestHex.java [XFRM_MSG_NEWSA] Support polling SA state with netlink message 2023-12-11 18:43:34 +00:00
LegacyTypeTrackerTest.kt Build ethernet framework source into framework-connectivity-tiramisu 2022-03-14 14:06:35 +00:00
NetIdManagerTest.kt Address comments on aosp/1781202 2022-08-17 07:11:55 +00:00
NsdServiceTest.java Implement offload only code path in NsdService for TV migration 2025-05-12 13:45:30 +09:00