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

This commit is contained in:
Dianne Hackborn
2010-08-20 14:10:41 -07:00
committed by Android (Google) Code Review
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

@@ -3691,8 +3691,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));
}