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

Commit a9888fc0 authored by Alex Klyubin's avatar Alex Klyubin Committed by android-build-merger
Browse files

resolve merge conflicts of febd982c to stage-aosp-master am: 5c53fdb8

am: b8246584

Change-Id: Ic1dd2aef96889f0f68a55093cfb04b4d90f34818
parents 52c35fb3 b8246584
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -298,8 +298,11 @@ public class NetworkPolicyManager {
        cal.set(Calendar.MINUTE, 0);
        cal.set(Calendar.SECOND, 0);
        if (cycleDay > cal.getActualMaximum(Calendar.DAY_OF_MONTH)) {
            cal.set(Calendar.DAY_OF_MONTH, 1);
            cal.add(Calendar.MONTH, 1);
            cal.set(Calendar.DAY_OF_MONTH, 1);
            cal.set(Calendar.HOUR_OF_DAY, 0);
            cal.set(Calendar.MINUTE, 0);
            cal.set(Calendar.SECOND, 0);
            cal.add(Calendar.SECOND, -1);
        } else {
            cal.set(Calendar.DAY_OF_MONTH, cycleDay);
+10 −0
Original line number Diff line number Diff line
@@ -544,6 +544,16 @@ public class NetworkPolicyManagerServiceTest extends AndroidTestCase {
        assertTimeEquals(expectedCycle, actualCycle);
    }

    public void testLastCycleBoundaryJanuaryDST() throws Exception {
        final long currentTime = parseTime("1989-01-26T21:00:00.000Z");
        final long expectedCycle = parseTime("1989-01-01T01:59:59.000Z");

        final NetworkPolicy policy = new NetworkPolicy(
                sTemplateWifi, 32, "America/Argentina/Buenos_Aires", 1024L, 1024L, false);
        final long actualCycle = computeLastCycleBoundary(currentTime, policy);
        assertTimeEquals(expectedCycle, actualCycle);
    }

    @Suppress
    public void testNetworkPolicyAppliedCycleLastMonth() throws Exception {
        NetworkState[] state = null;