Merge "Don't plot usage data beyond current date."

This commit is contained in:
TreeHugger Robot
2018-12-07 19:24:43 +00:00
committed by Android (Google) Code Review
2 changed files with 68 additions and 4 deletions

View File

@@ -95,9 +95,13 @@ public class ChartDataUsagePreference extends Preference {
final SparseIntArray points = new SparseIntArray();
points.put(0, 0);
final long now = System.currentTimeMillis();
long totalData = 0;
for (NetworkCycleData data : usageSummary) {
final long startTime = data.getStartTime();
if (startTime > now) {
break;
}
final long endTime = data.getEndTime();
// increment by current bucket total