Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e67463db authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Return "null" cycles for deprecated callers.

Callers using the deprecated Pair<ZonedDateTime, ZonedDateTime>
interface don't always check hasNext() before calling next(), so
give them (null, null) results instead of throwing.

Bug: 78020489
Test: builds, boots
Change-Id: Ibaeac646fa4e12e3e748cd7c706524d51dbeaafe
parent 213639c9
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -270,8 +270,12 @@ public class NetworkPolicyManager {

            @Override
            public Pair<ZonedDateTime, ZonedDateTime> next() {
                if (hasNext()) {
                    final Range<ZonedDateTime> r = it.next();
                    return Pair.create(r.getLower(), r.getUpper());
                } else {
                    return Pair.create(null, null);
                }
            }
        };
    }