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
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index b2606c1..a8aff37 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1377,6 +1377,19 @@
     <permission android:name="android.permission.CRYPT_KEEPER"
         android:protectionLevel="signatureOrSystem" />
 
+    <!-- Allows an application to read historical network usage for
+         specific networks and applications. @hide -->
+    <permission android:name="android.permission.READ_NETWORK_USAGE_HISTORY"
+        android:label="@string/permlab_readNetworkUsageHistory"
+        android:description="@string/permdesc_readNetworkUsageHistory"
+        android:protectionLevel="signature" />
+
+    <!-- Allows an application to manage network policies (such as warning and disable
+         limits) and to define application-specific rules. @hide -->
+    <permission android:name="android.permission.MANAGE_NETWORK_POLICY"
+        android:label="@string/permlab_manageNetworkPolicy"
+        android:description="@string/permdesc_manageNetworkPolicy"
+        android:protectionLevel="signature" />
 
     <!-- C2DM permission. 
          @hide Used internally.