Fix the getForegroundActivityTotalTimeMs

It should return milliseconds, not microseconds time

Bug: 63073847
Test: RunSettingsRoboTests
Change-Id: Ib7ddb947646062fc50a40d300829389e0ac401ee
This commit is contained in:
jackqdyulei
2017-06-27 15:59:35 -07:00
parent 38b7d50a49
commit 118e2baabe
2 changed files with 14 additions and 1 deletions

View File

@@ -330,7 +330,8 @@ public class BatteryUtils {
long getForegroundActivityTotalTimeMs(BatteryStats.Uid uid, long rawRealtimeMs) {
final BatteryStats.Timer timer = uid.getForegroundActivityTimer();
if (timer != null) {
return timer.getTotalTimeLocked(rawRealtimeMs, BatteryStats.STATS_SINCE_CHARGED);
return convertUsToMs(
timer.getTotalTimeLocked(rawRealtimeMs, BatteryStats.STATS_SINCE_CHARGED));
}
return 0;