[MS44.1] Add API to query tagged UID summary

Query tagged UID summary is currently needed by
StatsPullAtomService to collect tagged traffic statistics.
Add an Api via NetworkStatsManager to support this
functionality.

Test: atest NetworkStatsManagerTest
Bug: 204830222
Change-Id: Iaa54482a8109b56e66e829c5bec5a8a8f466641a
This commit is contained in:
Junyu Lai
2022-01-07 11:28:54 +00:00
parent e649046811
commit f577b2248b
4 changed files with 59 additions and 3 deletions

View File

@@ -766,8 +766,18 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
}
return stats;
} catch (NullPointerException e) {
// TODO: Track down and fix the cause of this crash and remove this catch block.
Log.wtf(TAG, "NullPointerException in getSummaryForAllUid", e);
throw e;
}
}
@Override
public NetworkStats getTaggedSummaryForAllUid(
NetworkTemplate template, long start, long end) {
try {
final NetworkStats tagStats = getUidTagComplete()
.getSummary(template, start, end, mAccessLevel, mCallingUid);
return tagStats;
} catch (NullPointerException e) {
throw e;
}
}