Refactor ProcessStats.

- Pull most of the inner classes out into their own files.
- Move everything to a new android.app.procstats package.
- Move all of the code that was manipulating the big list
  of longs to use the new SparseMappingTable class rather
  than doing everything by hand. The logic is unchanged.
- Add a sequence number check to SparseMappingTable so
  when the big list of longs and the individual tables are
  reset, which happens somewhat independently, we can
  assert when one of them doesn't get reset.
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index b4aa4cf..33a389a 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -24,7 +24,8 @@
 import android.util.DebugUtils;
 import android.util.EventLog;
 import android.util.Slog;
-import com.android.internal.app.ProcessStats;
+import com.android.internal.app.procstats.ProcessStats;
+import com.android.internal.app.procstats.ProcessState;
 import com.android.internal.os.BatteryStatsImpl;
 
 import android.app.ActivityManager;
@@ -69,7 +70,7 @@
     IApplicationThread thread;  // the actual proc...  may be null only if
                                 // 'persistent' is true (in which case we
                                 // are in the process of launching the app)
-    ProcessStats.ProcessState baseProcessTracker;
+    ProcessState baseProcessTracker;
     BatteryStatsImpl.Uid.Proc curProcBatteryStats;
     int pid;                    // The process of this application; 0 if none
     int[] gids;                 // The gids this process was launched with
@@ -443,7 +444,7 @@
 
     public void makeActive(IApplicationThread _thread, ProcessStatsService tracker) {
         if (thread == null) {
-            final ProcessStats.ProcessState origBase = baseProcessTracker;
+            final ProcessState origBase = baseProcessTracker;
             if (origBase != null) {
                 origBase.setState(ProcessStats.STATE_NOTHING,
                         tracker.getMemFactorLocked(), SystemClock.uptimeMillis(), pkgList);
@@ -469,7 +470,7 @@
 
     public void makeInactive(ProcessStatsService tracker) {
         thread = null;
-        final ProcessStats.ProcessState origBase = baseProcessTracker;
+        final ProcessState origBase = baseProcessTracker;
         if (origBase != null) {
             if (origBase != null) {
                 origBase.setState(ProcessStats.STATE_NOTHING,
@@ -695,7 +696,7 @@
 
                 }
                 pkgList.clear();
-                ProcessStats.ProcessState ps = tracker.getProcessStateLocked(
+                ProcessState ps = tracker.getProcessStateLocked(
                         info.packageName, uid, info.versionCode, processName);
                 ProcessStats.ProcessStateHolder holder = new ProcessStats.ProcessStateHolder(
                         info.versionCode);