Merge "DO NOT MERGE base: getDataUsageInfo get cycle validation"

This commit is contained in:
Treehugger Robot
2018-09-11 22:02:49 +00:00
committed by Gerrit Code Review

View File

@@ -134,7 +134,7 @@ public class DataUsageController {
final NetworkStatsHistory history = session.getHistoryForNetwork(template, FIELDS); final NetworkStatsHistory history = session.getHistoryForNetwork(template, FIELDS);
final long now = System.currentTimeMillis(); final long now = System.currentTimeMillis();
final long start, end; final long start, end;
if (policy != null) { if (policy != null && policy.hasCycle()) {
final Pair<ZonedDateTime, ZonedDateTime> cycle = NetworkPolicyManager final Pair<ZonedDateTime, ZonedDateTime> cycle = NetworkPolicyManager
.cycleIterator(policy).next(); .cycleIterator(policy).next();
start = cycle.first.toInstant().toEpochMilli(); start = cycle.first.toInstant().toEpochMilli();