Add some wifi tracking to battery stats.

Now track supplicant state and wifi signal strength.
Output looks like this:

         +12m45s235ms (1) 095 +wifi_full_lock +wifi_running wifi_signal_strength=3 wifi_suppl=scanning
         +12m46s095ms (1) 095 -wifi_full_lock wifi_suppl=associated
         +12m46s469ms (2) 095 wifi_suppl=completed +proc=u0a74:"com.google.android.videos"
         +12m52s103ms (1) 095 +wifi_full_lock wifi_suppl=disconn

Also modify history dump so that when we hit a RESET or START
command, we clear our previous history data, so the next event
will include new data.  This means if you are scanning through
the output, you must at this point clear any binary stats you
have like "running" or "wake_lock" or else you will continue to
think they are on until whatever point later they get turned on
and then back off.

And a small bug fix in proc stats that would cause the system
process to crash.

Change-Id: Ibec416a1ef786d428bd0d1d86e6e3296c41f7648
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index a5b80bc..2f25bd4 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -573,9 +573,9 @@
      */
     public boolean addPackage(String pkg, int versionCode, ProcessStatsService tracker) {
         if (!pkgList.containsKey(pkg)) {
+            ProcessStats.ProcessStateHolder holder = new ProcessStats.ProcessStateHolder(
+                    versionCode);
             if (baseProcessTracker != null) {
-                ProcessStats.ProcessStateHolder holder = new ProcessStats.ProcessStateHolder(
-                        versionCode);
                 holder.state = tracker.getProcessStateLocked(
                         pkg, info.uid, versionCode, processName);
                 pkgList.put(pkg, holder);
@@ -583,7 +583,7 @@
                     holder.state.makeActive();
                 }
             } else {
-                pkgList.put(pkg, null);
+                pkgList.put(pkg, holder);
             }
             return true;
         }