Small fixes to battery stats.

Change-Id: Ibbf7c548a8e787a046de3659094cea64908e3deb
This commit is contained in:
Dianne Hackborn
2010-09-09 16:45:15 -07:00
parent ee455f5a95
commit b8071d790a
2 changed files with 7 additions and 5 deletions

View File

@@ -1585,10 +1585,10 @@ public abstract class BatteryStats implements Parcelable {
sb.append(ent.getKey()); sb.append(":\n");
sb.append(prefix); sb.append(" CPU: ");
formatTime(sb, userTime); sb.append("usr + ");
formatTime(sb, systemTime); sb.append("krn\n");
formatTime(sb, systemTime); sb.append("krn");
if (starts != 0) {
sb.append(prefix); sb.append(" "); sb.append(starts);
sb.append(" proc starts");
sb.append("\n"); sb.append(prefix); sb.append(" ");
sb.append(starts); sb.append(" proc starts");
}
pw.println(sb.toString());
for (int e=0; e<numExcessive; e++) {

View File

@@ -3631,7 +3631,9 @@ public final class BatteryStatsImpl extends BatteryStats {
}
if (pid >= 0 && type == WAKE_TYPE_PARTIAL) {
Pid p = getPidStatsLocked(pid);
p.mWakeStart = SystemClock.elapsedRealtime();
if (p.mWakeStart == 0) {
p.mWakeStart = SystemClock.elapsedRealtime();
}
}
}
@@ -3642,7 +3644,7 @@ public final class BatteryStatsImpl extends BatteryStats {
}
if (pid >= 0 && type == WAKE_TYPE_PARTIAL) {
Pid p = mPids.get(pid);
if (p != null) {
if (p != null && p.mWakeStart != 0) {
p.mWakeSum += SystemClock.elapsedRealtime() - p.mWakeStart;
p.mWakeStart = 0;
}