Merge "Leave unmetered Wi-Fi network policies intact."

This commit is contained in:
Jeff Sharkey
2012-04-20 16:03:31 -07:00
committed by Android (Google) Code Review
2 changed files with 1 additions and 17 deletions

View File

@@ -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;
}
}

View File

@@ -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;