Interface-level network policy, persist policies.

Define NetworkPolicy as cycle-reset day and warning/limit values, and
set/get through NetworkPolicyManager.  Watch ConnectivityManager for
network connection events, and apply quota rules based on matching
interfaces.  Policy service matches based on strong identity to support
IMSI-specific policy values.

Calculates remaining quota based on current stats recorded since the
last reset cycle day.  Tests to verify edge cases around February.

Persist network and UID policies in XML, and restore on boot.

Change-Id: Id40ba7d6eed6094fbd5e18e6331286c606880d80
This commit is contained in:
Jeff Sharkey
2011-06-07 12:26:43 -07:00
parent 98693eb89a
commit 9d12bd2873
2 changed files with 42 additions and 16 deletions

View File

@@ -27,6 +27,8 @@ interface INetworkStatsService {
/** Return historical stats for specific UID traffic that matches template. */
NetworkStatsHistory getHistoryForUid(int uid, int networkTemplate);
/** Return usage summary for traffic that matches template. */
NetworkStats getSummaryForNetwork(long start, long end, int networkTemplate, String subscriberId);
/** Return usage summary per UID for traffic that matches template. */
NetworkStats getSummaryForAllUid(long start, long end, int networkTemplate);