diff options
| author | Dianne Hackborn <hackbod@google.com> | 2014-01-28 01:00:21 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-01-28 01:00:22 +0000 |
| commit | 4a4cfbe7d80256caea84e0f4bcf043178fd30d1c (patch) | |
| tree | 3b8a5c58afa4ca29b2c40f1665dcbd94eb5bf3b7 /core/java/android | |
| parent | e742799cae886e0e9b2eb5514e58bab27e34a0ee (diff) | |
| parent | 5f4a5f9536eb171bf21a9293198d90c9891e7205 (diff) | |
| download | frameworks_base-4a4cfbe7d80256caea84e0f4bcf043178fd30d1c.zip frameworks_base-4a4cfbe7d80256caea84e0f4bcf043178fd30d1c.tar.gz frameworks_base-4a4cfbe7d80256caea84e0f4bcf043178fd30d1c.tar.bz2 | |
Merge "Add "start time" timestamp to battery stats."
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/os/BatteryStats.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java index 1ce958b..2afea1f 100644 --- a/core/java/android/os/BatteryStats.java +++ b/core/java/android/os/BatteryStats.java @@ -27,6 +27,7 @@ import java.util.Map; import android.content.Context; import android.content.pm.ApplicationInfo; import android.telephony.SignalStrength; +import android.text.format.DateFormat; import android.util.Printer; import android.util.SparseArray; import android.util.TimeUtils; @@ -895,6 +896,11 @@ public abstract class BatteryStats implements Parcelable { public abstract long getNetworkActivityPackets(int type, int which); /** + * Return the wall clock time when battery stats data collection started. + */ + public abstract long getStartClockTime(); + + /** * Return whether we are currently running on battery. */ public abstract boolean getIsOnBattery(); @@ -1210,7 +1216,8 @@ public abstract class BatteryStats implements Parcelable { dumpLine(pw, 0 /* uid */, category, BATTERY_DATA, which == STATS_SINCE_CHARGED ? getStartCount() : "N/A", whichBatteryRealtime / 1000, whichBatteryUptime / 1000, - totalRealtime / 1000, totalUptime / 1000); + totalRealtime / 1000, totalUptime / 1000, + getStartClockTime()); // Calculate wakelock times across all uids. long fullWakeLockTimeTotal = 0; @@ -1587,7 +1594,9 @@ public abstract class BatteryStats implements Parcelable { formatTimeMs(sb, totalUptime / 1000); sb.append("uptime, "); pw.println(sb.toString()); - + pw.print(" Start clock time: "); + pw.println(DateFormat.format("yyyy-MM-dd-HH-mm-ss", getStartClockTime()).toString()); + final long screenOnTime = getScreenOnTime(batteryRealtime, which); final long phoneOnTime = getPhoneOnTime(batteryRealtime, which); final long wifiRunningTime = getGlobalWifiRunningTime(batteryRealtime, which); |
