android_packages_modules_Co.../service
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Junyu Lai 48c3c2bf10 Update start timestamp for querying data usage
The previous implementation used a fixed start timestamp for
querying network usage statistics, initialized based on the
device's boot time. This caused the query window to grow
indefinitely as the device uptime increased, leading to
inefficient queries that fetched and processed a large
ever-expanding amount of historical data.

This change refactors the logic to use a rolling start
timestamp. The `mStartTime` is now updated after each
usage report is generated (in `onLost`). By resetting
the start time to a more recent point (current time
minus one bucket duration), we ensure that subsequent
queries for usage snapshots are performed over a small,
manageable time window.

This optimization prevents fetching excessive data
from the NetworkStatsManager, improving the efficiency
of the metrics collector. Dependencies for time and
duration have also been abstracted for better testability.

Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.metrics.SatelliteCoarseUsageMetricsCollectorTest \
  --update-device
Flag: EXEMPT controlled with kill switch
Bug: 419123367
Change-Id: I49d3b044f0a038093060f5541ea263d2d0d253a2
2025-05-31 16:37:59 +08:00
..
aidl_api/connectivity_native_aidl_interface Vendor AIDL interface for port blocking via eBPF 2022-03-25 09:14:48 -07:00
binder/android/net/connectivity/aidl Vendor AIDL interface for port blocking via eBPF 2022-03-25 09:14:48 -07:00
jni change 'for-system' owner from root to clat 2025-03-14 09:23:23 -07:00
libconnectivity noop: change from deprecated __ANDROID_API_U__ to 34 2025-02-18 15:07:40 -08:00
native/libs/libclat libclat_test: use static libc++ 2025-02-21 11:59:49 -08:00
proto Add SystemMessages protos to Connectivity 2021-03-18 20:04:52 +09:00
ServiceConnectivityResources Automated log_list.json generation version 53.32 2025-05-03 10:14:23 -07:00
src/com/android Update start timestamp for querying data usage 2025-05-31 16:37:59 +08:00
Android.bp Report satellite coarse usage 2025-05-31 16:37:59 +08:00
jarjar-excludes.txt Conditionally include VCN in Tethering module 2024-12-09 12:04:12 -08:00
lint-baseline.xml Revert "Prepare for @RequiresApi class retention" 2024-06-26 19:14:30 +09:00
proguard.flags Move the Thread proguard flags to ConnectivityService's proguard.flags 2024-01-26 09:14:53 +00:00