OSDN Git Service

Support passing a template to NetworkStatsManager queries.
authorLorenzo Colitti <lorenzo@google.com>
Mon, 22 Jan 2018 12:00:49 +0000 (21:00 +0900)
committerLorenzo Colitti <lorenzo@google.com>
Mon, 22 Jan 2018 13:30:27 +0000 (22:30 +0900)
commite0f6909cba5aedb73c4e007baac330b9f6383d72
treea3bc59891a525b71e189d1c5c3348ab8ce6c9d02
parent53ba2f0c12e816a08b0fb737ef651a340a5ed0a4
Support passing a template to NetworkStatsManager queries.

Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
core/java/android/app/usage/NetworkStatsManager.java