Clear counters and delete tag data from NetworkStatsService.
Currently, NetworkStatsService deletes tag data by calling NetworkManagementSocketTagger, which then calls into libcutils "qtaguid" code. Instead, make NetworkStatsService call into libcutils directly and delete the NetworkManagementSocketTagger code. In the future, this will make it easier for NetworkStatsService to perform this operation by calling directly into BpfNetMaps. Because the unit test does not yet have working JNI code, provide an internal TagStatsDeleter interface that can be mocked out via the Dependencies class. This is a bit ugly but it will be deleted as soon as the code uses BpfNetMaps directly. Delete NetworkManagementSocketTagger#setKernelCounterSet since it was replaced in aosp/1958917. Also remove unused includes and make formatting changes suggested by clang-format. Test: m Test: atest NetworkStatsServiceTest Test: atest NetworkUsageStatsTest Test: atest TrafficStatsTest Test: stats deleted when CtsUsageStatsTestCases completes and test APK is uninstalled Change-Id: I62987000afc185199821580232bfb7668c8e301e
Loading
Please register or sign in to comment