b0efeaf8551e2867d771bff408ec83bead901631
Currently the NetworkStatsManager APIs allow applications to query for their own data usage by UID and tag, but do not allow applications to query by foreground/background state. This is causing popular apps to resort to parsing xt_qtaguid stats files directly. Because this is no longer allowed for apps targeting P and above, provide replacement functionality. This API allows apps to query for data usage for a given state, but not to receive data usage broken down by state. This is consistent with how the current UID and tag APIs work. It is also not an undue burden on apps: there are currently only two states of interest (FOREGROUND and everything else), and even if we add states in the future, unmodified apps can still obtain total traffic using STATE_ALL. Bug: 72977484 Test: New CTS test added in other change in this topic. Change-Id: Ic8c9194569ffd599b49e4a8197c5c2ea0ec3f7f7
Description
android_packages_modules_Connectivity
Languages
Java
81.4%
Kotlin
7.7%
AIDL
4.5%
C++
4.5%
C
1.7%
Other
0.1%