Don't plot usage data beyond current date.
- the new data usage api returns buckets for future date with 0 usage. When we plot the data usage chart, need to check the bucket date to make sure we only plot points up to the current date. Change-Id: I50e161ca9cdbb30c8fda8f6cdd24c993b546ad0d Fixes: 120490567 Test: make RunSettingsRoboTests
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user