summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-02-02 16:26:46 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-02 16:26:46 -0800
commit0370b9c3f76584462cffc3c283fcc70d9c8419c1 (patch)
tree765cb8f4508096ceb8de4ea54403169f53b77906 /src
parent840c6bfb96201b5e187616c11fa1944b321a65c2 (diff)
parent0d750bba7d75baa0dad177d1ff5dbd2234b42727 (diff)
downloadpackages_apps_settings-0370b9c3f76584462cffc3c283fcc70d9c8419c1.zip
packages_apps_settings-0370b9c3f76584462cffc3c283fcc70d9c8419c1.tar.gz
packages_apps_settings-0370b9c3f76584462cffc3c283fcc70d9c8419c1.tar.bz2
Merge "Update for NetworkPolicy refactoring."
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/net/NetworkPolicyEditor.java24
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;