Force poll NetworkStatsService before trigger atom pull
PollNetworkStatsActivity is a test app to force poll
NetworkStatsService to get updated network stats.
However, it was removed that causes the test won't force
update network stats before trigger atom pull. The app
sets a flag to force update stats by setPollForce which
is marked @UnsupportedAppUsage and the max target sdk is R
so the app cannot call the method today. But setPollForce
is a TestApi which can be called in the test. Thus, to get
the most updated network stats, adding a test method which
is doing the same thing as PollNetworkStatsActivity to
force poll NetworkStatsService.
Bug: 210073043
Test: build
BytesTransferredTest and check the output of atoms
Change-Id: I64648a8271a75a35650611aade5d2f48e02fcb06
2 files changed