am 32519259: Merge "Fix a few small battery stats problems:" into gingerbread

Merge commit '325192593b057f4360e1abddf490b4fae7d60b12' into gingerbread-plus-aosp

* commit '325192593b057f4360e1abddf490b4fae7d60b12':
  Fix a few small battery stats problems:
This commit is contained in:
Dianne Hackborn
2010-08-20 14:13:22 -07:00
committed by Android Git Automerger
2 changed files with 3 additions and 2 deletions

View File

@@ -1400,6 +1400,7 @@ public abstract class BatteryStats implements Parcelable {
pw.println(getDischargeStartLevel());
pw.print(prefix); pw.print(" Discharge cycle current level: ");
pw.println(getDischargeCurrentLevel());
} else {
pw.print(prefix); pw.println(" Device is currently plugged into power");
pw.print(prefix); pw.print(" Last discharge cycle start level: ");
pw.println(getDischargeStartLevel());

View File

@@ -3693,8 +3693,8 @@ public final class BatteryStatsImpl extends BatteryStats {
mTrackBatteryPastRealtime += realtime - mTrackBatteryRealtimeStart;
mDischargeCurrentLevel = level;
if (level < mDischargeUnplugLevel) {
mLowDischargeAmountSinceCharge = mDischargeUnplugLevel-level-1;
mHighDischargeAmountSinceCharge = mDischargeUnplugLevel-level;
mLowDischargeAmountSinceCharge += mDischargeUnplugLevel-level-1;
mHighDischargeAmountSinceCharge += mDischargeUnplugLevel-level;
}
doPlugLocked(getBatteryUptimeLocked(uptime), getBatteryRealtimeLocked(realtime));
}