diff options
Diffstat (limited to 'services/java/com/android/server/am/BatteryStatsService.java')
-rw-r--r-- | services/java/com/android/server/am/BatteryStatsService.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java index 33bbc13..37da6f7 100644 --- a/services/java/com/android/server/am/BatteryStatsService.java +++ b/services/java/com/android/server/am/BatteryStatsService.java @@ -59,7 +59,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub { public void shutdown() { Slog.w("BatteryStats", "Writing battery stats before shutdown..."); synchronized (mStats) { - mStats.writeLocked(); + mStats.shutdownLocked(); } } @@ -124,14 +124,14 @@ public final class BatteryStatsService extends IBatteryStats.Stub { public void noteStartGps(int uid) { enforceCallingPermission(); synchronized (mStats) { - mStats.noteStartGps(uid); + mStats.noteStartGpsLocked(uid); } } public void noteStopGps(int uid) { enforceCallingPermission(); synchronized (mStats) { - mStats.noteStopGps(uid); + mStats.noteStopGpsLocked(uid); } } @@ -321,14 +321,10 @@ public final class BatteryStatsService extends IBatteryStats.Stub { return mStats.isOnBattery(); } - public void setOnBattery(boolean onBattery, int level) { + public void setBatteryState(int status, int health, int plugType, int level, + int temp, int volt) { enforceCallingPermission(); - mStats.setOnBattery(onBattery, level); - } - - public void recordCurrentLevel(int level) { - enforceCallingPermission(); - mStats.recordCurrentLevel(level); + mStats.setBatteryState(status, health, plugType, level, temp, volt); } public long getAwakeTimeBattery() { @@ -359,7 +355,8 @@ public final class BatteryStatsService extends IBatteryStats.Stub { for (String arg : args) { if ("--checkin".equals(arg)) { isCheckin = true; - break; + } else if ("--reset".equals(arg)) { + mStats.resetAllStatsLocked(); } } } |