summaryrefslogtreecommitdiffstats
path: root/core/java/android/os/BatteryStats.java
diff options
context:
space:
mode:
authorEric Shienbrood <>2009-03-24 18:13:20 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-24 18:13:20 -0700
commitd4c5f8919b0522bcaab41a5863c313fec52d3a79 (patch)
treef1465254ddd3ab57865aa5e77ff24ecfe3e47ba5 /core/java/android/os/BatteryStats.java
parent4a5c1a7e84a250eafe0e3a12d859c45747520d55 (diff)
downloadframeworks_base-d4c5f8919b0522bcaab41a5863c313fec52d3a79.zip
frameworks_base-d4c5f8919b0522bcaab41a5863c313fec52d3a79.tar.gz
frameworks_base-d4c5f8919b0522bcaab41a5863c313fec52d3a79.tar.bz2
Automated import from //branches/donutburger/...@140679,140679
Diffstat (limited to 'core/java/android/os/BatteryStats.java')
-rw-r--r--core/java/android/os/BatteryStats.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 76c74df..d492b6a 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -292,7 +292,7 @@ public abstract class BatteryStats implements Parcelable {
* {@hide}
*/
public abstract long getPhoneOnTime(long batteryRealtime, int which);
-
+
/**
* Returns the time in milliseconds that wifi has been on while the device was
* running on battery.
@@ -300,7 +300,15 @@ public abstract class BatteryStats implements Parcelable {
* {@hide}
*/
public abstract long getWifiOnTime(long batteryRealtime, int which);
-
+
+ /**
+ * Returns the time in milliseconds that wifi has been on and the driver has
+ * been in the running state while the device was running on battery.
+ *
+ * {@hide}
+ */
+ public abstract long getWifiRunningTime(long batteryRealtime, int which);
+
/**
* Returns the time in milliseconds that bluetooth has been on while the device was
* running on battery.
@@ -535,6 +543,7 @@ public abstract class BatteryStats implements Parcelable {
final long screenOnTime = getScreenOnTime(batteryRealtime, which);
final long phoneOnTime = getPhoneOnTime(batteryRealtime, which);
final long wifiOnTime = getWifiOnTime(batteryRealtime, which);
+ final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which);
final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which);
StringBuilder sb = new StringBuilder(128);
@@ -549,7 +558,8 @@ public abstract class BatteryStats implements Parcelable {
// Dump misc stats
dumpLine(pw, 0 /* uid */, category, MISC_DATA,
- screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000, bluetoothOnTime / 1000);
+ screenOnTime / 1000, phoneOnTime / 1000, wifiOnTime / 1000,
+ wifiRunningTime / 1000, bluetoothOnTime / 1000);
if (which == STATS_UNPLUGGED) {
dumpLine(pw, 0 /* uid */, category, BATTERY_DATA, getUnpluggedStartLevel(),
@@ -667,7 +677,7 @@ public abstract class BatteryStats implements Parcelable {
final long rawUptime = SystemClock.uptimeMillis() * 1000;
final long rawRealtime = SystemClock.elapsedRealtime() * 1000;
final long batteryUptime = getBatteryUptime(rawUptime);
- final long batteryRealtime = getBatteryUptime(rawRealtime);
+ final long batteryRealtime = getBatteryRealtime(rawRealtime);
final long whichBatteryUptime = computeBatteryUptime(rawUptime, which);
final long whichBatteryRealtime = computeBatteryRealtime(rawRealtime, which);
@@ -692,6 +702,7 @@ public abstract class BatteryStats implements Parcelable {
final long screenOnTime = getScreenOnTime(batteryRealtime, which);
final long phoneOnTime = getPhoneOnTime(batteryRealtime, which);
+ final long wifiRunningTime = getWifiRunningTime(batteryRealtime, which);
final long wifiOnTime = getWifiOnTime(batteryRealtime, which);
final long bluetoothOnTime = getBluetoothOnTime(batteryRealtime, which);
pw.println(prefix
@@ -701,6 +712,8 @@ public abstract class BatteryStats implements Parcelable {
+ "(" + formatRatioLocked(phoneOnTime, whichBatteryRealtime)
+ "), time with wifi on: " + formatTimeMs(wifiOnTime / 1000)
+ "(" + formatRatioLocked(wifiOnTime, whichBatteryRealtime)
+ + "), time with wifi running: " + formatTimeMs(wifiRunningTime / 1000)
+ + "(" + formatRatioLocked(wifiRunningTime, whichBatteryRealtime)
+ "), time with bluetooth on: " + formatTimeMs(bluetoothOnTime / 1000)
+ "(" + formatRatioLocked(bluetoothOnTime, whichBatteryRealtime)+ ")");