Update to follow BatteryStats.

Change data use to be based on packets instead of bytes.

Change-Id: I536dd2c2fc3fbeb12689e793f79e5fac984fe3af
This commit is contained in:
Dianne Hackborn
2013-12-12 16:17:49 -08:00
parent 73fed2c477
commit fb03058dc9
5 changed files with 62 additions and 46 deletions

View File

@@ -361,7 +361,7 @@ public class BatteryHistoryChart extends View {
final HistoryItem rec = new HistoryItem();
while (stats.getNextHistoryLocked(rec)) {
pos++;
if (rec.cmd == HistoryItem.CMD_UPDATE) {
if (rec.isDeltaData()) {
if (first) {
first = false;
mHistStart = rec.time;
@@ -523,7 +523,7 @@ public class BatteryHistoryChart extends View {
if (mStats.startIteratingHistoryLocked()) {
final HistoryItem rec = new HistoryItem();
while (mStats.getNextHistoryLocked(rec) && i < N) {
if (rec.cmd == BatteryStats.HistoryItem.CMD_UPDATE) {
if (rec.isDeltaData()) {
x = (int)(((rec.time-timeStart)*w)/timeChange);
y = mLevelTop + levelh - ((rec.batteryLevel-batLow)*(levelh-1))/batChange;