First pass at NetworkPolicy and activity tracking.

New system service that maintains low-level network policy rules and
collects statistics to drive those rules.  Will eventually connect to
netfilter kernel module through NetworkManagementService and "netd".

Begin tracking foreground activities in ActivityManagerService, which
is updated as part of OOM adjustment.  Eventually a network policy of
POLICY_REJECT_BACKGROUND will reject network traffic from background
processes.

Change-Id: I5ffbbaee1b9628e9c3eff6b9cb2145fc5316e64d
diff --git a/services/java/com/android/server/am/ProcessRecord.java b/services/java/com/android/server/am/ProcessRecord.java
index 5be35ee..beef136 100644
--- a/services/java/com/android/server/am/ProcessRecord.java
+++ b/services/java/com/android/server/am/ProcessRecord.java
@@ -64,6 +64,7 @@
     boolean keeping;            // Actively running code so don't kill due to that?
     boolean setIsForeground;    // Running foreground UI when last set?
     boolean foregroundServices; // Running any services that are foreground?
+    boolean foregroundActivities; // Running any activities that are foreground?
     boolean bad;                // True if disabled in the bad process list
     boolean killedBackground;   // True when proc has been killed due to too many bg
     String waitingToKill;       // Process is waiting to be killed when in the bg; reason