diff options
| author | Dianne Hackborn <hackbod@google.com> | 2013-09-04 18:03:40 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2013-09-04 18:03:40 -0700 |
| commit | 49021f5f790c31f62d4cee9fafcae13505bed798 (patch) | |
| tree | 66b5d82067e10c6d0008ec87e56ed65408d2cb5d /core/java | |
| parent | 52ea7f57ed08ea982dcb125b564b5509ef8dc3b6 (diff) | |
| download | frameworks_base-49021f5f790c31f62d4cee9fafcae13505bed798.zip frameworks_base-49021f5f790c31f62d4cee9fafcae13505bed798.tar.gz frameworks_base-49021f5f790c31f62d4cee9fafcae13505bed798.tar.bz2 | |
Fix issue #10422349: Limit/change the battery history data in batterystats
Don't include history in real checkins; have a new compact option
for bug reports.
Change-Id: I077f9218b365154f6bae9cc685c2c6b378e0283a
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/os/BatteryStats.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 38ffb96..dbaa325 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -2380,22 +2380,25 @@ public abstract class BatteryStats implements Parcelable { @SuppressWarnings("unused") public void dumpCheckinLocked( - PrintWriter pw, List<ApplicationInfo> apps, boolean isUnpluggedOnly) { + PrintWriter pw, List<ApplicationInfo> apps, boolean isUnpluggedOnly, + boolean includeHistory) { prepareForDumpLocked(); long now = getHistoryBaseTime() + SystemClock.elapsedRealtime(); - final HistoryItem rec = new HistoryItem(); - if (startIteratingHistoryLocked()) { - HistoryPrinter hprinter = new HistoryPrinter(); - while (getNextHistoryLocked(rec)) { - pw.print(BATTERY_STATS_CHECKIN_VERSION); pw.print(','); - pw.print(0); pw.print(','); - pw.print(HISTORY_DATA); pw.print(','); - hprinter.printNextItemCheckin(pw, rec, now); - pw.println(); + if (includeHistory) { + final HistoryItem rec = new HistoryItem(); + if (startIteratingHistoryLocked()) { + HistoryPrinter hprinter = new HistoryPrinter(); + while (getNextHistoryLocked(rec)) { + pw.print(BATTERY_STATS_CHECKIN_VERSION); pw.print(','); + pw.print(0); pw.print(','); + pw.print(HISTORY_DATA); pw.print(','); + hprinter.printNextItemCheckin(pw, rec, now); + pw.println(); + } + finishIteratingHistoryLocked(); } - finishIteratingHistoryLocked(); } if (apps != null) { |
