External mutation of full NetworkPolicy set.

Instead of embedding complex template coexistence rules into policy
service, rely on external editors to enforce, and offer atomic
get/set operations for full policy sets.

Generate default mobile policy when none exists, using default of 4GB
warning and cycle reset of current day.  Dispatch listener events
through Handler when holding internal lock, and catch CLASS_UNKNOWN
networks in 3G_LOWER template.

Change-Id: I063cf1eaf330e32b75d0697b89fc04488e6dfaea
This commit is contained in:
Jeff Sharkey
2011-06-12 21:13:51 -07:00
parent 755000588f
commit 709e40027d

View File

@@ -41,11 +41,9 @@ public class TrafficStats {
*/
public final static int UNSUPPORTED = -1;
// TODO: find better home for these template constants
/**
* Template to combine all {@link ConnectivityManager#TYPE_MOBILE} style
* networks together. Only uses statistics for currently active IMSI.
* networks together. Only uses statistics for requested IMSI.
*
* @hide
*/
@@ -54,7 +52,7 @@ public class TrafficStats {
/**
* Template to combine all {@link ConnectivityManager#TYPE_MOBILE} style
* networks together that roughly meet a "3G" definition, or lower. Only
* uses statistics for currently active IMSI.
* uses statistics for requested IMSI.
*
* @hide
*/
@@ -63,7 +61,7 @@ public class TrafficStats {
/**
* Template to combine all {@link ConnectivityManager#TYPE_MOBILE} style
* networks together that meet a "4G" definition. Only uses statistics for
* currently active IMSI.
* requested IMSI.
*
* @hide
*/
@@ -184,6 +182,17 @@ public class TrafficStats {
}
}
/** {@hide} */
public static boolean isNetworkTemplateMobile(int networkTemplate) {
switch (networkTemplate) {
case TEMPLATE_MOBILE_3G_LOWER:
case TEMPLATE_MOBILE_4G:
case TEMPLATE_MOBILE_ALL:
return true;
}
return false;
}
/**
* Get the total number of packets transmitted through the mobile interface.
*