Make running services initial update async.

Also fix the value show for an app's awake time.

Change-Id: I801681d3a1d47a6bb1f3fb8cc5b0ef009201146f
This commit is contained in:
Dianne Hackborn
2010-08-15 17:28:36 -07:00
parent be5994d201
commit ff3673c7f4
4 changed files with 62 additions and 10 deletions

View File

@@ -392,16 +392,12 @@ public class PowerUsageSummary extends PreferenceActivity implements Runnable {
for (Map.Entry<String, ? extends BatteryStats.Uid.Wakelock> wakelockEntry
: wakelockStats.entrySet()) {
Uid.Wakelock wakelock = wakelockEntry.getValue();
BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_FULL);
// Only care about partial wake locks since full wake locks
// are canceled when the user turns the screen off.
BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);
if (timer != null) {
wakelockTime += timer.getTotalTimeLocked(uSecTime, which);
}
timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);
if (timer != null) {
wakelockTime += timer.getTotalTimeLocked(uSecTime, which);
}
// Note: not considering window, since that is just the system
// keeping the screen on while the app is running.
}
wakelockTime /= 1000; // convert to millis