summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-04-19 23:02:09 -0700
committerJeff Sharkey <jsharkey@android.com>2012-04-19 23:02:09 -0700
commitbf60154a45ec9e470da18ddcfca37462fe69bf5e (patch)
treedf62bfe9275d62a4a443ae2e20ac0dd7a48dc6a2 /src/com/android
parentfcc5063e4de9d7e738b6b082343b9c25fb065954 (diff)
downloadpackages_apps_Settings-bf60154a45ec9e470da18ddcfca37462fe69bf5e.zip
packages_apps_Settings-bf60154a45ec9e470da18ddcfca37462fe69bf5e.tar.gz
packages_apps_Settings-bf60154a45ec9e470da18ddcfca37462fe69bf5e.tar.bz2
Leave unmetered Wi-Fi network policies intact.
They are now removed when the WifiConfiguration is deleted. Bug: 6344821, 6369307 Change-Id: Id411fa06cec10435501ef03c56d0bcb96ed229db
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/settings/net/DataUsageMeteredSettings.java11
-rw-r--r--src/com/android/settings/net/NetworkPolicyEditor.java7
2 files changed, 1 insertions, 17 deletions
diff --git a/src/com/android/settings/net/DataUsageMeteredSettings.java b/src/com/android/settings/net/DataUsageMeteredSettings.java
index d069a71..4967611 100644
--- a/src/com/android/settings/net/DataUsageMeteredSettings.java
+++ b/src/com/android/settings/net/DataUsageMeteredSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.net;
+import static android.net.wifi.WifiInfo.removeDoubleQuotes;
import static com.android.settings.DataUsageSummary.hasReadyMobileRadio;
import static com.android.settings.DataUsageSummary.hasWifiRadio;
@@ -120,14 +121,4 @@ public class DataUsageMeteredSettings extends SettingsPreferenceFragment {
mPolicyEditor.setPolicyMetered(mTemplate, isChecked());
}
}
-
-
- private static String removeDoubleQuotes(String string) {
- final int length = string.length();
- if ((length > 1) && (string.charAt(0) == '"') && (string.charAt(length - 1) == '"')) {
- return string.substring(1, length - 1);
- }
- return string;
- }
-
}
diff --git a/src/com/android/settings/net/NetworkPolicyEditor.java b/src/com/android/settings/net/NetworkPolicyEditor.java
index 07a2afb..5fe4c06 100644
--- a/src/com/android/settings/net/NetworkPolicyEditor.java
+++ b/src/com/android/settings/net/NetworkPolicyEditor.java
@@ -214,13 +214,6 @@ public class NetworkPolicyEditor {
} else {
if (policy == null) {
// ignore when policy doesn't exist
- } else if (policy.template.getMatchRule() == MATCH_WIFI
- && policy.warningBytes == WARNING_DISABLED
- && policy.limitBytes == LIMIT_DISABLED) {
- // when WIFI goes unmetered, and no other warning/limit for
- // policy, clean it up.
- mPolicies.remove(policy);
- modified = true;
} else if (policy.metered) {
policy.metered = false;
policy.inferred = false;