summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-06-02 12:42:12 -0700
committerDianne Hackborn <hackbod@google.com>2014-06-02 12:42:12 -0700
commitfc0641340ff927d9c35d5613723d25858f751118 (patch)
tree09ef9a4305fdc2d1eabec9264074425c402f5100 /core/java/android
parent725010a83f1798e5ba6edb93ca2656a96c29fcae (diff)
downloadframeworks_base-fc0641340ff927d9c35d5613723d25858f751118.zip
frameworks_base-fc0641340ff927d9c35d5613723d25858f751118.tar.gz
frameworks_base-fc0641340ff927d9c35d5613723d25858f751118.tar.bz2
Some battery stats history fixes.
- Now the full wake history uses the history tag if it can. Hopefully this will still result in a consistent history, since that isn't really want the tag is for... but the current implementation in places will probably make this work. - Possibly fix a bug with inconsistent state between partial history snapshots: after a snapshot is printed, don't allow any more batching into the most recent history entry, so the next snapshot will not miss anything that might get placed into it soon after. Also rework command line arguments for enable/disable to make these commands instead of options. Change-Id: Ia33445cad1538bf8df549cef284f1e736efbc079
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/os/BatteryStats.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index bc57b33..e627d49 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -931,6 +931,14 @@ public abstract class BatteryStats implements Parcelable {
}
}
+ /**
+ * Don't allow any more batching in to the current history event. This
+ * is called when printing partial histories, so to ensure that the next
+ * history event will go in to a new batch after what was printed in the
+ * last partial history.
+ */
+ public abstract void commitCurrentHistoryBatchLocked();
+
public abstract int getHistoryTotalSize();
public abstract int getHistoryUsedSize();
@@ -3366,6 +3374,7 @@ public abstract class BatteryStats implements Parcelable {
}
}
if (histStart >= 0) {
+ commitCurrentHistoryBatchLocked();
pw.print(checkin ? "NEXT: " : " NEXT: "); pw.println(lastTime+1);
}
}