summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/net
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-07-20 16:59:16 -0700
committerJeff Sharkey <jsharkey@android.com>2011-07-27 09:31:51 -0700
commit271ec8a8f81ab714e45cc8c7814ea3c5dfb3f36a (patch)
treeaae3a11864382d9857e9dc16aa5635001e21afab /src/com/android/settings/net
parent7485addd8c230812b33f7043de3ff47d97b79bc1 (diff)
downloadpackages_apps_settings-271ec8a8f81ab714e45cc8c7814ea3c5dfb3f36a.zip
packages_apps_settings-271ec8a8f81ab714e45cc8c7814ea3c5dfb3f36a.tar.gz
packages_apps_settings-271ec8a8f81ab714e45cc8c7814ea3c5dfb3f36a.tar.bz2
Move data over-limit dialog, reset policy snooze.
Moved over-limit dialog to SystemUI, and followed Intent changes to read full NetworkTemplate. When mutating NetworkPolicy, always reset any snooze. Bug: 5057979, 4723336 Change-Id: I9a975eb4ced2f4020c2fe74af67625541cbfcd85
Diffstat (limited to 'src/com/android/settings/net')
-rw-r--r--src/com/android/settings/net/NetworkPolicyEditor.java25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/com/android/settings/net/NetworkPolicyEditor.java b/src/com/android/settings/net/NetworkPolicyEditor.java
index 1e64ec2..81cf78e 100644
--- a/src/com/android/settings/net/NetworkPolicyEditor.java
+++ b/src/com/android/settings/net/NetworkPolicyEditor.java
@@ -17,6 +17,7 @@
package com.android.settings.net;
import static android.net.NetworkPolicy.LIMIT_DISABLED;
+import static android.net.NetworkPolicy.SNOOZE_NEVER;
import static android.net.NetworkPolicy.WARNING_DISABLED;
import static android.net.NetworkTemplate.MATCH_MOBILE_3G_LOWER;
import static android.net.NetworkTemplate.MATCH_MOBILE_4G;
@@ -100,17 +101,23 @@ public class NetworkPolicyEditor {
}
public void setPolicyCycleDay(NetworkTemplate template, int cycleDay) {
- getPolicy(template).cycleDay = cycleDay;
+ final NetworkPolicy policy = getPolicy(template);
+ policy.cycleDay = cycleDay;
+ policy.lastSnooze = SNOOZE_NEVER;
writeAsync();
}
public void setPolicyWarningBytes(NetworkTemplate template, long warningBytes) {
- getPolicy(template).warningBytes = warningBytes;
+ final NetworkPolicy policy = getPolicy(template);
+ policy.warningBytes = warningBytes;
+ policy.lastSnooze = SNOOZE_NEVER;
writeAsync();
}
public void setPolicyLimitBytes(NetworkTemplate template, long limitBytes) {
- getPolicy(template).limitBytes = limitBytes;
+ final NetworkPolicy policy = getPolicy(template);
+ policy.limitBytes = limitBytes;
+ policy.lastSnooze = SNOOZE_NEVER;
writeAsync();
}
@@ -155,17 +162,19 @@ public class NetworkPolicyEditor {
mPolicies.remove(policy4g);
mPolicies.add(
new NetworkPolicy(templateAll, restrictive.cycleDay, restrictive.warningBytes,
- restrictive.limitBytes));
+ restrictive.limitBytes, SNOOZE_NEVER));
writeAsync();
} 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));
- mPolicies.add(new NetworkPolicy(
- template4g, policyAll.cycleDay, policyAll.warningBytes, policyAll.limitBytes));
+ mPolicies.add(
+ new NetworkPolicy(template3g, policyAll.cycleDay, policyAll.warningBytes,
+ policyAll.limitBytes, SNOOZE_NEVER));
+ mPolicies.add(
+ new NetworkPolicy(template4g, policyAll.cycleDay, policyAll.warningBytes,
+ policyAll.limitBytes, SNOOZE_NEVER));
writeAsync();
}