diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-02-02 16:12:00 -0800 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-02-02 16:12:00 -0800 |
commit | 0d750bba7d75baa0dad177d1ff5dbd2234b42727 (patch) | |
tree | 40c50488cdc129d859c54f0830a1687f3fdfec47 /src | |
parent | 7ed71b7896c2572f8f876e100a0b8c1689632e2f (diff) | |
download | packages_apps_settings-0d750bba7d75baa0dad177d1ff5dbd2234b42727.zip packages_apps_settings-0d750bba7d75baa0dad177d1ff5dbd2234b42727.tar.gz packages_apps_settings-0d750bba7d75baa0dad177d1ff5dbd2234b42727.tar.bz2 |
Update for NetworkPolicy refactoring.
Bug: 5262414
Change-Id: I17db862cc20a11f022dc2d02993ad52988618681
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/net/NetworkPolicyEditor.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/com/android/settings/net/NetworkPolicyEditor.java b/src/com/android/settings/net/NetworkPolicyEditor.java index c9407ce..a1c7371 100644 --- a/src/com/android/settings/net/NetworkPolicyEditor.java +++ b/src/com/android/settings/net/NetworkPolicyEditor.java @@ -145,8 +145,7 @@ public class NetworkPolicyEditor { time.setToNow(); final int cycleDay = time.monthDay; - return new NetworkPolicy( - template, cycleDay, WARNING_DISABLED, LIMIT_DISABLED, SNOOZE_NEVER, true); + return new NetworkPolicy(template, cycleDay, WARNING_DISABLED, LIMIT_DISABLED, true); } public int getPolicyCycleDay(NetworkTemplate template) { @@ -156,7 +155,7 @@ public class NetworkPolicyEditor { public void setPolicyCycleDay(NetworkTemplate template, int cycleDay) { final NetworkPolicy policy = getOrCreatePolicy(template); policy.cycleDay = cycleDay; - policy.lastSnooze = SNOOZE_NEVER; + policy.clearSnooze(); writeAsync(); } @@ -167,7 +166,7 @@ public class NetworkPolicyEditor { public void setPolicyWarningBytes(NetworkTemplate template, long warningBytes) { final NetworkPolicy policy = getOrCreatePolicy(template); policy.warningBytes = warningBytes; - policy.lastSnooze = SNOOZE_NEVER; + policy.clearSnooze(); writeAsync(); } @@ -178,7 +177,7 @@ public class NetworkPolicyEditor { public void setPolicyLimitBytes(NetworkTemplate template, long limitBytes) { final NetworkPolicy policy = getOrCreatePolicy(template); policy.limitBytes = limitBytes; - policy.lastSnooze = SNOOZE_NEVER; + policy.clearSnooze(); writeAsync(); } @@ -249,21 +248,18 @@ public class NetworkPolicyEditor { : policy4g; mPolicies.remove(policy3g); mPolicies.remove(policy4g); - mPolicies.add( - new NetworkPolicy(templateAll, restrictive.cycleDay, restrictive.warningBytes, - restrictive.limitBytes, SNOOZE_NEVER, restrictive.metered)); + mPolicies.add(new NetworkPolicy(templateAll, restrictive.cycleDay, + restrictive.warningBytes, restrictive.limitBytes, restrictive.metered)); return true; } else if (!beforeSplit && split) { // duplicate existing policy into two rules final NetworkPolicy policyAll = getPolicy(templateAll); mPolicies.remove(policyAll); - mPolicies.add( - new NetworkPolicy(template3g, policyAll.cycleDay, policyAll.warningBytes, - policyAll.limitBytes, SNOOZE_NEVER, policyAll.metered)); - mPolicies.add( - new NetworkPolicy(template4g, policyAll.cycleDay, policyAll.warningBytes, - policyAll.limitBytes, SNOOZE_NEVER, policyAll.metered)); + mPolicies.add(new NetworkPolicy(template3g, policyAll.cycleDay, policyAll.warningBytes, + policyAll.limitBytes, policyAll.metered)); + mPolicies.add(new NetworkPolicy(template4g, policyAll.cycleDay, policyAll.warningBytes, + policyAll.limitBytes, policyAll.metered)); return true; } else { return false; |